Fixed image format recognition

Here's modifications to imageinfo. The library didn't recognize JPG files, because all strings are now by default UTF-8 and direct comparison between UTF-8 and ASCII-8BIT does not work.