fixed bug in pager building function caused by error in calc of pages count; fixes #7