For a proper implementation of T71456: [Story] Use MediaViewer on commonsMedia properties on Wikibase repo we would need a way to make the MediaViewer work for images that are not present in the DOM.
In my experimental gadget, I work around that by adding small thumbs of the pictures I want to cover to mw.util.$content (but hide them visually). I would be nice if that could be avoided.