Gallery Code Upgrade

Its now a plugin