You can’t use -----> .target = “_self”; on a —> GALLARY !!!
Why ???
Because this property do not exist on a GALLARY…
https://www.wix.com/velo/reference/$w/gallery
You can use this attribute on a → BUTTON ← for example.
https://www.wix.com/velo/reference/$w/button
If Wix do not offer such options —> you simply can’t use it.
The only way would be to generate your own CUSTOM-GALLERY from scratch inside a CUSTOM-ELEMENT or an HTML-Component (iFrame):
But this would be a lot of CODE and working TIME !!!