Fix for crash if for some reason the image can't be parsed