Jpeginfo can be used to generate informative listings of jpeg files, and also to check jpeg files for errors. It can also detect broken jpeg and delete them automatically.
Since libjpeg only supports a limited subset of the JPEG standard (ITU 81), only JPEG codestream with huffman and sequential lossy 8bits are supported