Changed how the GetImageFormat function checks for jpegs. For some reason different jpegs have different 4th byte value, so we must check just 3 of them. I just added a jpeg3 and jpeg4 for different byte sequences, but this would lower the certainty, but it wont be 100% safe anyway