panorama: only change z-index if mask exists