Avoid errors when regions extend past the bounds of the image..