Fix gif parsing for image versioning.

Fix + tests to ensure gifs, pngs, and jpgs are processed correctly.