just add an alias to your img
subdomain and keep the same structure. This way if you need to change in the future it will be transparent
edit:
is also good to have more than one subdomain for assets. like img01
img02
and so on. But be these subdomains consistent.
like if you have the image image1.jpg
that targets to
http://img01.domain.com/images/image1.jpg
the next time the imagen appears in the code should appear as
http://img01.domain.com/images/image1.jpg
AND NOT as
http://img02.domain.com/images/image1.jpg
so the cache can optimize the calls.
I usually use this formula
return sprintf("http://img%02s.domain.com", abs(crc32($imagename) % (9)));
this way the subdomain will be always consistent with the image name
edit 2:
Browsers limit the amount of connection opens peer server. So by having multiple subdomains you are faking
this and therefore improving the load speed of the page.
But in the other hand if for a same image you load it from more
than one different server the browser's cache can't operate because it doesn't know that you want to load the same image.
So by hashing the image name you are obtaining always the same server and then obtaining the best of both worlds: more connections opens AND browser caching