find . | grep 'JPG' | nl -nrz -w3 -v0001 | while read n f; do mv "$f" "$n.JPG"; done