update adGallery library

Also moves library to new "common" folder. The intent is to use this
common folder to hold libraries used in multiple places to prevent
duplication.
remove flash related item
flush theme list on duplicate/delete
move common code to COMMON_FOLDER