I think an easier way of doing this, would be to remove the update server behavior when clicking the delete button, and instead you could just add this code:
<?php
if(isset($_POST["deletephoto"])){
$_POST['currentphoto'] = "";
}
?>
before your regular update server behavior. And set the trigger to be any form post for the update server behavior.