Handles lesser than pageSize as well.