Make sure the id is safe before setting the filename as id