Rendering HTML to image from JS