Fix total pages for custom limit offset