Bug 1058853 - Don't break the gallery if we have corrupt images

This seems like a useful addition.

Is there any way that we can detect the corrupt image before we get to this stage, though? Like in the jpeg metadata parser?  What is actually corrupt about the sample image that causes this bug and can we detect that earlier?