Added logic to locate X and Y co-ordinates on a canvas and paint an image