Filter wix gallery by dropdowns

Hi everyone, I tried to filter my images on the gallery and i used the video below that did that for repeater so i tried to convert it for gallery. I got the error: " Cannot read property ‘items’ of undefined" on line 21.
The code is:

// For full API documentation, including code examples, visit Velo API Reference - Wix.com

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

});

////////////////////////////////////////////////m
import {wixData} from ‘wix-data’ ;

export function button1_click(event, $w) {
$w( “#dataset1” ).setFilter(wixData.filter()

.contains( "subject" , $w( '#dropdown2' ).value) 
.contains( "technique" , $w( '#dropdown1' ).value) 
.contains( "signature" , $w( '#dropdown3' ).value) 
.contains( "exhibitions" , $w( '#dropdown4' ).value)) 

.then((results)=> {
console.log( “Dataset is now filtered” );
$w( “#gallery1” ).items = results.items; //line 21!!!
}). catch ((err)=>{
console.log(err);
});
$w( “#gallery1” ).expand();

}

Thank you guys for your help :slight_smile: