Fixed an issue with non-jpeg images.