Take the count from allFiles instead of enumerating the uploads folder twice.