Refining mime check

It is better to check the image not by its seen extension, but by its origin header of creation. 
So when image are renamed from png to jpg, it wont threat that image as png
because the library like GD would get error.