Convert image_helper to javascript

No changes to spec, all pass.