only presorting fileids if there are too many