Fixed bug that caused edges to be created around the border of the image