diff --git a/src/TwigTweakExtension.php b/src/TwigTweakExtension.php index ea04e2e..59e05a9 100644 --- a/src/TwigTweakExtension.php +++ b/src/TwigTweakExtension.php @@ -246,11 +246,13 @@ class TwigTweakExtension extends AbstractExtension { ->getStorage('file') ->loadByProperties([$selector_type => $selector]); - // To avoid ambiguity render nothing unless exact one image has been found. - if (count($files) != 1) { + if (count($files) < 1) { return []; } + // To avoid ambiguity order by fid. + ksort($files); + $file = reset($files); return \Drupal::service('twig_tweak.image_view_builder')->build($file, $style, $attributes, $responsive, $check_access); }