Rewriting picture URL's to new domain

A few months ago, I switched my domain to a new one. Now some of the pictures that you click return a 404 not found. Is there anyway to rewrite all media URL's to the current domain so the 404 errors disappear?

I know it also has to be bad for SEO, Google running in to these errors, so it would be nice if this is fixable.