if modifying query's limit is null, set to original query's pagination limit (which may be null itself). also for offset