Pages contain many images. Is it possible to create a report that shows which are not used

In Kirby Panel, we have a web page with dozens of images, but only 2 are physically assigned to image slots on the page. How do we determine which ones are not being used?

As long as images are only used in defined fields (files fields), it should be easy. Then you only need to get all files, exclude the ones used in those fields, and you have a list of unused ones.

It gets more complicated if images are used inside textarea or blocks/layouts fields.