Better error checking and avoidance of images with no ROI.