Fixed TIFF and JIF detection