Set number per page before calculating pages