Use Exif Data to check the image type, Do not rely on extention

Use the file signature where available rather than the file name. Sometimes images can be displayed with the wrong extension and may go unnoticed such as a jpg renamed to a gif or vise versa 

This PR allows the image to resize these misnamed files.