Change name didn't work if reset initialization it's true

If user initializes the upload library with the reset flag as true, the uploaded file wasn't changed, so I have added the same lines from #350 into the return where the reset flag it's setted to TRUE.