updated exception catching in image_helper.py