Deal with mangled image files.