fix gen_gallery.py for docs generation

- move template read from module level to generate_gallery_html()
update docstring of gen_gallery.py - describe docs regeneration steps