Added way to specify custom pagination wrapper. This fixes some problems on the pagination.