Js and view in elements

Dan asked chatgpt to create some JS code to randomly load an image from a number of images, I then wrote some tailwind to display,
it works, I tried custom component Image well but finds image but does not display in safari (finds the image though, bug as you mentioned) also the images with my external links do not show in Elements only in safari. probably me as I was not sure what to do with the JS
I was refreshing safari, cannot see in video

see video
https://www.dropbox.com/scl/fo/ntu738fixviiwk4jwbcq4/ACFmGAIsS6eeob1o2BWS6C0?rlkey=p42obo8m80762likrfuv194gv&st=11qim3ss&dl=0