Iterate over items in FieldItemList?
PHP calls getIterator() for you, you don't have to do that. Also use $variables['node'], much easier to access.

File/Image references an extension of entity references, which means they inherit the computed ->entity property, which automatically loads the referenced entity. Make sure you check if the file can be loaded, or inconsistent data (if, for some reason, the file gets deleted. Less likely for files but could happen for node or other references) would result in a fatal error.

foreach ($variables['node']-&gt;photos as $item) {
  if ($item-&gt;entity) {
    $uri = $item-&gt;entity-&gt;getFileUri();
  }
}


$uri is something like 'public://your_file.jpg'. You can create a public url with file_create_url() or you can also pass it to an image style entity's buildUrl() method to get the URL for a given image style.

See http://wizzlern.nl/drupal/drupal-8-entity-cheat-sheet for common ways to access field values, what properties exist for each field type and much more.