Rearchitect so that the onload function is defined before the img.src
Fallback for IE8 not supporting .innerHTML