I am not experienced with html2image, but maybe it can parse the inline CSS only and that's the reason because the resulting image is not the same as is rendered in the browser.
Try adding an inline style with the contens of main.css to your HTML and save an image again.