Previously I was opening files before the file was guaranteed
to be of a certain type. Therefore, .gifs were saved as .jpg
as an example. Fixed that.