You can simple change line
move_uploaded_file($_FILES['profilepicture']['tmp_name'], $profimg);
into
move_uploaded_file($_FILES['profilepicture']['tmp_name'], 'profileimages/'.$profimg);
Of course directory profileimages must exist and have enough permissions to move there file