move ImageData handling into gfx.js
fix a few names in gfx.js