how about a function to create the /Mars container - so you could simply use delete("/Mars") to remove the container including all images and create a new, empty one on the fly. Should be faster than iterating through a list?!
But since you get an unique id for each image - maybe you should store those in a separate note and fetch only the new ones?
Still as a JSON demo it is perfect as it is
Feel free to imporve and upload your own version. Recall, these files were demos hacked out to help (beta test) users get a feel for the new functions and how they work. I’m sure (@eastgate is welcome to correct me!) that they weren’t written as 'best use examples.
Indeed if community members with the relevant skills can polish and improve the starting model, that’s great! If doing so, please explain what you’ve added/changed and as importantly why.
Let’s be community minded, improvement in this context isn’t a competition but both (a) an opportunity to contribute expertise others may not (yet) have and (b) a means to help others learn. Throughout my years of using computers and code most of my learning has come from the open-handed help of others rather than teaching and I’m keen to pay that generosity forward by helping others.
In closing, in case it appears otherwise, this is not a critique of @webline’s post but just encouragement to use all to contribute. As well as better code, iIt’s also useful to hear from those who find examples too complex or lacking in hand-holds for learning. We don’t know what we don’t know!