improve gen_gallery.py

- modify static resources link (-l flag)
- update doc/gallery_template.html
fix output suffix for time-dependent problems in generate_images()