PHP Code:
GetSQLValueString($_POST['userID'], "int"),
GetSQLValueString($_POST['imgID'], "int"),
GetSQLValueString($_POST['glryID'], "int"));
Why are you reverting to the post-data? Are these individual values? Aren't the image-ids now available as $imgID? That is, the values of the checkboxes.
PHP Code:
GetSQLValueString($imgID, "int"),