On 28 Jun 2012, Calvin Morrison uttered the following:
use an image program to open the image that will error out and close if the file is corrupt.
Or use ImageMagick's identify(1), which will quit in both success and failure cases with different exit codes.