Found math error in buildImageEdges