rewrite case 'del_images' to these one:
case 'del_images':
$additional_images_id = tep_db_prepare_input($HTTP_GET_VARS['pID']);
if ( ($HTTP_POST_VARS['products_id']) && (is_array($HTTP_POST_VARS['additional_images_id'])) ) {
$product_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);
$additional_images_id = $HTTP_POST_VARS['additional_images_id'];
for ($i=0; $i<sizeof($additional_images_id); $i++) {
tep_db_query("delete from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . tep_db_input($additional_images_id[$i]) . "'");
}
}
//tep_db_query("delete from " . TABLE_ADDITIONAL_IMAGES . " where additional_images_id = '" . $HTTP_POST_VARS['additional_images_id'] . "'");
tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));
break;