Zend certified PHP/Magento developer

How to fix the error where powershell can’t erase a certain part of a file name while that file already exist?

I have a lot of .JPG files that need to be renamed and some have the same name with different files sizes for multiple reasons and they need to be kept. To be more precise I need to remove a certain part of the name of these files and so far the command that I have been using is as follows:

gci *.JPG | rename-item -newname { $_.Name -Replace ( '(.{6})(..)(.*$)' , '$1$3' ) } 

but because there are items with the same names I keep on getting an error which tells me that powershell cant replace an item that already exists and I need a solution.