Fully functional code. Correctly processes images using EXIF code 36867 which is for the DateTime the image was created. If this metadata does not exist, it defaults to the datecreated of the file.
Videos do not seem to have metadata which stores the datecreated and is defaulting to the date the video file was created. Will look into this later.