Check for all boundaries of the image.