usa file_exists

se esiste rinomini.

ma quella aggiunta che fai non la capisco.