If this is something publicly facing, you should make sure to limit the variables that submitted, so someone doesn't submit something nefarious like "../../../index.php".
Anyway, you could do it more simply:
function editPicture($old, $new){
unlink($old);
copy("../" . $new);
}
If you want to move the file, use rename. If you want to actually make a copy, then use copy.