apply paginate on galleries