Refining mime check, not from ext

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.  

i come down with the fix, but correct me if i'am wrong. thank you