P.S. it’ll only show Wix image elements of type Image. If you have other images that you added via the custom code section etc… (and not via the editor), you’ll have to use a custom element with the regular JS - DOM you posted.
See the documentation on $w . The third code snippet (“Select all the images on the page” - on the right side of the page), shows how to select all of the Wix Image elements on the page.
Does this also work on repeaters? I have images being loaded from a dataset into a repeater (about 30 images) and only get “$w(‘#image1’)” as the result which is the only pre-existing image in the repeater.