$sql = "INSERT INTO ".IMAGES_TABLE."
(cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments, image_date2".$additional_field_sql.")
VALUES
($cat_id, $user_id, '$image_name', '$image_description', '$image_keywords', $current_time, $image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments, $image_date2".$additional_value_sql, .")";
$result = $site_db->query($sql);
$image_id = $site_db->get_insert_id();