Setup canvas only once test image has loaded

We were running into an issue where the canvas would attempt to
initialize before the image required for that step had loaded. Instead
of parsing an element on the page it now does it only in the script and
hooks into the onload function.