Updates for Gallery plugin support

Added rewrite rules and some base variables