Fix bug when window doesn't start redraw image on resize.