Here is an alternative solution using a generic collection
var sl = new System.Collections.Generic.SortedList<string, FileInfo>();
foreach (var f in file)
{
var jpgName = f.Name;
var resultString = System.Text.RegularExpressions.Regex.Match(jpgName, @"\d+").Value;
int res;
if(int.TryParse(resultString, out res))
{
jpgName = String.Format("{0}{1}", jpgName.Replace(resultString, ""), res.ToString("0000000"));
}
sl.Add(jpgName, f);
}