Hi Pablo,
if you are filtering for a collection, for example Avalon, and click on second page, it still shows other collections and resets the filter. This way you can replicate the problem I think.
After adding the code in the functions.php, the problem still exists…