Dynamic gallery filtered on dynamic page select

i tried to follow along with this thread but my page loads all pictures then all disappear.

is any one able to help me out.

iv linked and ID column (number) from my pictures table to another table for projects
i select a project and a dynamic page is loaded that needs to filter images for only that project.

the code is:

import wixData from ‘wix-data’;

$w.onReady(function () {
$w(‘#dynamicDataset’).onReady(() => {
var GalleryID = $w(“#dynamicDataset”).getCurrentItem().galleryLinkId;
$w(‘#dataset2’).setFilter(wixData.filter().eq(‘GalleryLinkId’, GalleryID));
});
});

both datasets are loaded
the tables have the same gallerylinkid column set as number
iv tried replacing the filter galleryid with just a number but still no luck

please i have hit a roadblock with this one.
appreciate any help i can get.

ok well i go it to work if i changed the 2 id tables to text.
I’d love if some one could help explain what the issue was and how it can be used with the ID column as number.

thanks