So, in my case, I am creating a collection from previously input values by the user into the app on load of the below screen.
The first gallery is filtering this collection as below

The second gallery which, in my case, is hidden from the user, is filtering the same collection to other parameters.

What you could do is get all your data into a collection OnVisible of the page where your galleries are, and then apply your filters to the collections in the galleries as above.
Thanks
K.