I have a loop in Twig template, which returns multiple values. Most important - an ID of my entry. When I didn't use any framework nor template engine, I used simply `file_exists()` within the loop. Now, I can't seem to find a way to do it in Twig.

When I display user's avatar in header, I use `file_exists()` in controller, but I do it because I don't have a loop.

I tried `defined` in Twig, but it doesn't help me. Any ideas?