Changed regex in file_to_id sub to allow for dots in filenames.

This just removes the last dot in a file name. Still not perfect though.