Just in case, here is the whole code.
<?php
$escape = $this->plugin('escapeHtml');
$this->htmlElement('body')->appendAttribute('class', 'item resource show');
$this->headScript()->prependFile($this->assetUrl('js/lightslider.min.js'));
$this->headScript()->prependFile($this->assetUrl('js/lightgallery.min.js'));
$this->headLink()->prependStylesheet($this->assetUrl('css/lightgallery.min.css'));
$this->headLink()->prependStylesheet($this->assetUrl('css/lightslider.min.css'));
$lightMedia = [];
$otherMedia = [];
$sortedSubjects = [];
$subjectValues = $item->subjectValues();
?>
<?php foreach ($item->media() as $media): ?>
<?php $mediaType = $media->mediaType(); ?>
<?php $mediaRenderer = $media->renderer(); ?>
<?php if ((strpos($mediaType, 'image') !== false) || (strpos($mediaRenderer, 'youtube') !== false)): ?>
<?php $lightMedia[] = $media; ?>
<?php else: ?>
<?php $otherMedia[] = $media; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php echo $this->pageTitle($item->displayTitle(), 2); ?>
<?php echo $this->translate('Item'); ?>
<?php $this->trigger('view.show.before'); ?>
<?php if ($item->media()): ?>
<?php foreach ($lightMedia as $media): ?>
<?php $source = ($media->originalUrl()) ? $media->originalUrl() : $media->source(); ?>
-
<?php echo $media->render(); ?>
<?php endforeach; ?>
<?php endif; ?>
<?php if (count($otherMedia) > 0): ?>
<div class="media-embeds">
<?php
foreach ($otherMedia as $media) {
echo '<h5>' . $media->displayTitle() . '</h5>';
echo $media->render();
}
?>
<?php endif; ?>
<?php echo $item->displayValues(); ?>
<?php if (count($otherMedia) > 0): ?>
<?php echo $this->translate('Other Media'); ?>
<?php foreach($otherMedia as $media): ?>
<?php echo $media->linkPretty(); ?>
<?php endforeach; ?>
<?php endif; ?>
<?php $itemSets = $item->itemSets(); ?>
<?php if (count($itemSets) > 0): ?>
<?php echo $this->translate('Item sets'); ?>
<?php foreach ($item->itemSets() as $itemSet): ?>
<?php endforeach; ?>
<?php endif; ?>
<?php
$page = $this->params()->fromQuery('page', 1);
$property = $this->params()->fromQuery('property');
$subjectValues = $item->displaySubjectValues($page, 25, $property);
?>
<?php if ($subjectValues): ?>
<?php echo $this->translate('Linked resources'); ?>
<?php echo $subjectValues; ?>
<?php endif; ?>
<?php $this->trigger('view.show.after'); ?>