rewrite graphics to use <canvas> instead of <img> for sprite storage