Added touching edge

This has some issues if the image dimensions are larger than the image itself