Improved image format detection

The format detection based on `BufferedImage.TYPE_INT_RGB` doesn't seem to work correctly. 

I have a bunch of JPEG files that has been recognized as PNG, leading to very large image files (PNG for "photos" is not an appropriate format).

I modified the code to do the detection based on the first two bytes of the original file. The code is looking for the JPEG "first bytes" signature (found here: http://www.garykessler.net/library/file_sigs.html).