Do not crash when input image is invalid.