Ensure we are dealing with a valid image.