It will not work like that. It is designed to update based on user-configurable fields from a form. However what you want is a pretty easy query to just run on the page like:
<?php
mysql_select_db($database_connRoSite, $connRoSite);
mysql_query("UPDATE pageimages SET SortOrder = RepImgID WHERE SortOrder IS NULL", $connRoSite);
?>