Fix: checking of x1 & y1 proximity to line segment ends
Adding code for image saving