replace dots in filename to only have one dot before the extension