Fixed bug at corner of image: do the same as when there is no intersection