Adding a function to draw lines on the image