The code you posted produces lines with points in the corners of the image for me when the image is 72ppi.
Could you post a screenshot of the faulty results with the pertinent Panels visible?
Okay, but what's so special about using 72 DPI?
At 72ppi 1 pixel corresponds with 1 point.