fix horrible slow implementation of draw_lines
better image drawing test routines