er.style.width = widthPct + 'vw';
			wrapper.style.height = heightPct + 'vh';
			wrapper.style.overflow = 'hidden';
			wrapper.style.pointerEvents = 'none'; // let clicks pass through overlay by default

			let mediaElement;
			if (mediaType === 'image') {
				mediaElement = document.createElement('img');
				mediaElement.src = url;
				mediaElement.style.width = '100%';
				mediaElement.style.height = '100%';
				mediaElement.style.objectFit = 'contain';
				mediaElement.style.maxWidth = '100%'; // overrid