Function drawPolylineOnImage