#488 fixed some bugs when grouping by pack and moved construction of pagination links to search_form