Small optimizations 1

A couple of small optimizations.
We shall not batch long running operations such as paint image, shading pattern or smask compositing (on restore) -- scrolling will suffer and "long running script" dialog will pop-up. Please revert this change.