How to bulk rename in OS X with my requirements
The following lines in Terminal should do the trick

for dir in my-pictures/*; do
    if [[ -d "$dir" ]]; then
        cd "$dir"
        i=0
        for file in *; do
            echo mv "$file" $(printf "%04d" $i).png
            (( i=i+1 ))
        done
        cd -
    fi
done


I've put in an echo statement to suppress execution so you can test it first. If the output looks ok, just remove the echo and rerun.

This assumes that there are no more than 1000 files in each subfolder, none of the files is already renamed and that all of them are PNG pictures.

By default, files are sorted by name. If you want to sort by date, replace the second for statement with

for file in $(ls -t); do