BUG:368727 Don't crash on using the scratchpad
It is perfeclty possible to paint on a paint device without having an image, so check for that.