@php
$picturesCollection = collect($pictures);
$images = $picturesCollection->filter(fn($pic) => str_starts_with($pic['mime_type'], 'image/'))->values(); // reindex
$videos = $picturesCollection->filter(fn($pic) => str_starts_with($pic['mime_type'], 'video/'))->values(); // reindex
$orderedPictures = $images->concat($videos)->values();
@endphp
@forelse($orderedPictures as $key => $media)
@if (str_starts_with($media['mime_type'], 'image/'))
{!! imgTag($media['filename'], 'big', ['alt' => $titleSlug . '-big-' . $key]) !!}
@elseif (str_starts_with($media['mime_type'], 'video/'))
@endif
@empty
@endforelse