Fix gallery after filtering