Make image format detection case insensitive