Moving repeated files from one folder to another
Maybe you try with this pseudocode:


get files list from directory
declare array for crc
for each file in directory
check if the mime content type is correct
get crc for file 
check if this crc is in array for crc
if is in array move it
else push crc into array


Thanks Pimgd. You are right. I should write it on the beginning. First of all there is only one loop, so if you have a lot of files, it will be faster. Second, it checks content file, so you will not touch not image files. Third, the code will be more clear.