Move rescue block from image_handler to one level higher