fix crash if wrong image is downloaded