build unique filename as xxx-random.ext, not xxx.ext-random