Change name didn't work it reset initialization

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.