custom template filter to group a list into subsets of a specific size