check JPEG format in `jpeg_segmenting`