Bug fix(workaround). Delayed resize/attach timing after the image is loaded

In some cases, Chrome didn't draw anything if once the canvas got the
size of zero. Its displayed normally after receiving any input event.
Other browsers worked fine. Anyway it's fixed now