Use Imagick for mime type detection

Use Imagick instead of fileinfo to detect the mime type of added images. Should fix #222.