ls *.jpg | sort | cat -n
番号付き出力でこんな感じで行けそうだけどawk/sedは詳しく知らない

で調べたら
ls *.jpg | awk '{printf"%s %04d.py\n", $1, NR}' | bash