I found the solution and will post it here for future users.
The vault that had image zoom was using the “minimal” theme. I found the scripting which allows this and added it to my other vault using a different theme.
/* Image zoom */
.view-content .markdown-preview-view img {
max-width:100%;
cursor:zoom-in;}
.view-content .markdown-preview-view img[referrerpolicy='no-referrer']:active,
.view-content .image-embed:active {
cursor:zoom-out;
display:block;
z-index:100;
position:fixed;
max-height:calc(100% + 1px);
max-width:calc(100% - 20px);
height:calc(100% + 1px);
width:100%;
object-fit:contain;
margin:-0.5px auto 0;
text-align:center;
padding:0;
left:0;
right:0;
bottom:0;
background:var(--background-translucent);
}
.view-content .markdown-preview-view img[referrerpolicy='no-referrer']:active {
padding:2.5%;
}
.view-content .markdown-preview-view .image-embed:active img {
top:50%;
transform:translateY(-50%);
padding:0;
margin:0 auto;
width:auto;
max-height:95vh;
left:0;
right:0;
bottom:0;
position:absolute;
opacity:1;
}
.theme-dark span[src$="#invert"] img {
filter: invert(1) hue-rotate(180deg);
mix-blend-mode: screen;
}
/* --------------- */