Fixed code to seek within a file, added code to convert image to a supported format before returning it, if necessary