$db_props = CIBlockElement::GetProperty($arFields["IBLOCK_ID"], $arFields['ID'], "sort", "asc", Array("CODE"=>"NEWS_PHOTO"));
$arrPhoto = array();
while($ar_props = $db_props->Fetch())
{
if ($ar_props["VALUE"])
{
$ar_val = $ar_props["VALUE"];
$ar_val_id = $ar_props["PROPERTY_VALUE_ID"];
$img_path = CFile::GetPath($ar_props["VALUE"]);
if (!empty($img_path)){
$arrPhoto[] = $img_path;
}
else{
continue;
}
}
}
эту строку $type_object это что?