gallery part updates

DRYs up gallery
adds tha entry hooks
cleans up code