Use MakeGlobalVariablesScript to set wgMediaViewerOnClick

Use MakeGlobalVariablesScript instead of ResourceLoaderGetConfigVars
to set wgMediaViewerOnClick because the first is cached per-site
and we need per-user caching.

Change-Id: Ib4d99698030b69532b5996fa6b981f2b5c556a23
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/263