Hey guys my bad was doin the renaming in the wrong place. I'll just post my hack in case anyone needs something similar.
$ImageCustomName = $userfile['name'];
$rand = rand(100000, 999999);
$ndate = date('YmdHis');
$file_ext = ( strrpos( $ImageCustomName, '.' ) ) ? substr( $ImageCustomName, strrpos( $ImageCustomName, '.' ) + 1 ) : '';
$ImageCustomName = $ndate.'_'.strval($rand) . "." . $file_ext;
So the result will be on each uploaded image the name will change to something like this: 20140702105640_272184.jpg
It has date time and a random number. This way you will never have issues with duplicate image names ;)