Load gallery from database

Thanks for that, but it helps me not really. Actually I’ve already studied the whole reference regarding the gallery, but it didn’t help me to build correctly the array or /options?
I also searched the forum for a example code how to build the array, but I didn’t find something. By the way I don’t work with a dataset!
I’m sorry, but I did my first steps in JavaScript some days ago, so nothing is really clear to me.
I get x items with 3 fields each (photo, title, description) from the database by wixdata.query. The only question is: How can I build the correct array in order to load the gallery.
But ok, I’ll find the solution.