a non existing subdomain is added to image urls
This is rather big guess, but I think you have everything configured so that your virtual host is responding to all subdomains for your primary domain.  In Apache terms this would be something like

ServerName mysite.com
ServerAlais *.mysite.com


And, you have old links that are getting crawled from the old subdomains, and the net result are some bad URLs are being cached.

My suggestion would be to add something like this to your .htaccess

RewriteCond %{HTTP_HOST} !www\.mysite\.com [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]


Make sure this goes right after the RewriteEngine on in the stock Drupal version.  I don't think the two example rules in the file will work, as they assume just adding/removing the www and don't take subdomains into account (though I am not 100% sure about this; I haven't looked at these closely in a while).  Make sure you clear Drupal cache, too.

Also make sure you back up the file after you change it, so you have the additions the next time you upgrade core.