Set GD to ignore invalid JPEGs

In case the jpeg file is damaged, GD won't load it and throw errors. This commit fixes this by settings a GD flag as recommended by others.

It works :)