Fix an assert when resizing image with a shape layer
The delay of the timer should be changed only when the timer is stopped.