Delay drawing the shape until the image is loaded

Fixes the test in Chrome.