Renaming picture files with date
Why don't you use the exif timestamps of your images and name them accordingly? I use the following code to rename my images. It also extends the timestamp to feature not only the date but also the time:

import os
import glob
from PIL import Image
from PIL.ExifTags import TAGS
import time  

def get_exif(fn):
    ret = {}
    i = Image.open(fn)
    info = i._getexif()
    for tag, value in info.items():
        decoded = TAGS.get(tag, tag)
        ret[decoded] = value
    return ret

os.chdir("/path/to/images")

files = glob.glob("*.JPG")

for file in files:
    print(file)
    time = get_exif(file)["DateTimeOriginal"]

    time = time.replace(":", "")
    time = time.replace(" ", "_")
    number = 0
    new_name = time+"_additional_information.jpg"
    if new_name == file:
        print(new_name, "already ok")
        continue
    while os.path.exists(new_name):
        number += 1
        new_name = time+"_"+str(number)+"_additional_information.jpg"
    os.rename(file, new_name)


If you want to use your own code, why don't you just test it on a copy of the data?