Well, you want to sort by the filename first, then on the int part:
def splitter( fn ):
try:
name, num = fn.rsplit('_',1) # split at the rightmost `_`
return name, int(num)
except ValueError: # no _ in there
return fn, None
sorted(the_list, key=splitter)