Create a dummy thumbnail if PIL throws an exception on a bad image
This can happen if the image is truncated, for example.
This might not be the best approach to solving this problem, but it at least stops the scanner from crashing and gives the user something to look at in the thumbnail. Perhaps another image (exclamation mark?) would be better.
Edited by Paolo Benvenuto