fixing editing and restoring of media #142

This does a couple things:

1. Fixes editing of media uploaded to S3 so that edits point properly to new uploaded files.
2. Caches the original generated `$prefix` so that when restoring an image, we just flip back to the original stored images.

Seemed to work well for me.