Hard Refactoring of functions.php - Rebuilt the gallery script to pull f...

...rom custom post type - added TGM Plugin Activation supprt