dropdown to connect "Stores/Products" dataset and display filtered results in gallery

hi guys, I have been trying to achieve this but to no avail. I thought it would be simple but after hiring a free-lancer to fix it, they also came back with “Im sorry I think I can’t help you”. They tried and i am posing their code below. can anyone help me out please?

I have a drop-down on a static page.
The drop-down is connected to the Wix “Stores/Prodcuts” dataset
there is a Wix Pro Gallery that is connected to the same dataset (“Stores/Products”)

In my Stores/Products database, I have hundreds of products and each product is associated with “Flavor” collections like “Apple, Banana, etc”.
The result I was after is that I decide about 20 “Flavors” like Apple, Banana, Coconut, etc to be entered into the drop-down
When a selection is made from the drop-down flavors, the dataset pulls ONLY those products in my database that have that particular selection like Apple, and displays the results in the gallery
If a new selection is made, the gallery updates the results to show only the newly selected flavor.

below is the free-lancer’s code but it is still not working. If anyone has ideas, please help me out!

ps. I think instead of using a Pro Gallery, he may have used a grid gallery, but even that will be fine, though after checking all the non-Pro galleries, there is only one grid gallery that has the settings which allow me to configure how the product images display (not cropped)

thanks

// For full API documentation, including code examples, visit Velo API Reference - Wix.com
import wixData from ‘wix-data’ ;

// …

$w.onReady( function () {
//TODO: write your page related code here…

});

export async function button0_click(event) {
//Add your code for this event here:
let flavour = $w( ‘#dropdown1’ ).value;

$w( "#dataset1" ).setFilter( wixData.filter() 
  .hasSome( "collections" , flavour) 
) 

let results = await wixData.query( “Stores/Products” )
.hasSome( “collections” , flavour)
.find()
let galleryItems =; //to store the imag items for the gallery
let image ={}; //to create the item in the gallery items format “src”:“/image…”
let keys = [ ‘src’ ]
results.items.forEach((element)=>{
let values = [element.imageSrcFieldKey]
keys.forEach((key, i)=> image[key]=values[i])
galleryItems.push(image)
image ={};
})

$w( "#gallery1" ).items = galleryItems; 
console.log(galleryItems) 

}

export function button00_click(event) {
//Add your code for this event here:
$w( ‘#dropdown1’ ).value = “” ;