Vid 1976

Refactoring the new media galleries so they are rendered client side. This handles issues surrounding lazy loading. 
I no understand JS very good.  This declaration of `Media` allows line 49 to work?