on the edit gallery page, create a hidden form element that will capture the id url variable:
<input type="hidden" name="id" id="id" value="<?php echo(isset($_GET['id'])?$_GET['id']:""); ?>
then in the Update record behavior, set the redirect URL to the details page and pass the id variable:
details.php?id=<?php echo(isset($_POST['id'])?$_POST['id']:""); ?>
on the details page, you can use the id URL variable to filter the recordset.