Use the mime type to sniff what type of image we have instead of using the extension.

Brings in:
https://github.com/sortsmill/fontforge/commit/373ff5af95b1511560d37c7b498142cc7e8a9d51

This is only the top commit, it seems best to dig back to:
0a0bb72b5da3d6aaec893f68fbe7440fce2c2eae
Bringing in some stuff from the previous two commits, back to
0a0bb72b5da3d6aaec893f68fbe7440fce2c2eae
from the sortsmill.
Merge pull request #163 from monkeyiq/2012oct/mimetypes2

Some updates for mime handling from sortsmill