Media_source gives authentication error

I am trying to use the Media dir for storing my local entity pictures I would like to use on my lovelace cards etc.

Example:

sensor.custom_image:
  entity_picture: /media/local/pictures/entities/custom-image.png

But it gives me this error and no image is shown:

Login attempt or request with invalid authentication from XPS (192.168.10.11). See the log for details.

Why do I get “request with invalid authentication”?

according to this:
Standard Attachments | Home Assistant Companion Docs (home-assistant.io)

The media_source integration has the advantage that access requires authentication headers (which Home Assistant provides to the companion app). This means the content is not publicly available.
You can use relative URLs in the format /media/local/direct.jpg with this integration.
info
A file stored in /media/file.jpg on-disk is represented by /media/local/file.jpg in the notification. Note the addition of the local part of the path.

Is what i did if i am correct: entity_picture: /media/local/pictures/entities/custom-image.png

On an other page it says:

Files served from media are protected by Home Assistant authentication unlike those served from www .

So this is probably where it goes wrong and i get an error:

Login attempt or request with invalid authentication from XPS (192.168.10.11). See the log for details.

The logs:

Logger: homeassistant.components.http.ban
Bron: components/http/ban.py:135
integratie: HTTP (documentatie, problemen)
Eerst voorgekomen: 12:26:32 (2 gebeurtenissen)
Laatst gelogd: 12:26:32

Login attempt or request with invalid authentication from XPS (192.168.10.11). Requested URL: '/media/local/pictures/entities/custom-image.png'. (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36)

But i have no idea why because I am connected local and the files are all local.
Do I need to set some other settings to use the media dir?