cache the image only at the end of the touch
added experimental code for partial redraw