Get only the pages that do not have a file

Hello. What’s the best way to gather a collection of pages that do not have a image? Is there a built in filter? I can image getting a collection then checking each page with the hasImage() function but is that necessary? Thanks.

No, you can filter by hasImages():

$articles = page('whatever')->children()->filterBy('hasImages', false);

More fun with filtering: https://getkirby.com/docs/cookbook/filtering