clean up code moved from HTML
add comment, remove redundant code
update gallery info