Re-add code to rewrite image urls.
Include test.