Fixed endless loop when processing broken images.
Merge pull request #10 from mibe/master

Endless loop on broken images