Fix handling of duplicate copy for local copies.

This is an obvious fix. When dealing with local copies we want the cache
filename to reference original picture.