Handles the image errors