When PowerApps binds an Image control to this URL, the request for the image is NOT authenticated.
Only URLs that come from supported data types from within the SharePoint connector get rewritten so that PowerApps will be able to authenticate them safely.
Why does it work in browsers (sometimes) then?
The reason it can sometimes work in browsers (e.g. when using Web Authoring or Web Player) is that browsers utilize cookies to perform authentication.
So when the browser makes the request to the sharepoint.com URL, it's not using PowerApps authentication tokens to authorize the request; it's using cookies stored by the browser for that domain.
Method 1 - Add the files as SharePoint list attachments.
Create a new SharePoint list.
For each file you need to access, create an item.
When creating the item, add the file as an attachment of the list item.
On the PowerApps access the list item attachment and use it on a media control. For example: a. App has a gallery control. Gallery2.Items is set to "listmp3", where "listmp3" is a SharePoint list that has mp3 file attached to the items. There is one list item per file. b. App has an audio control . Audio1.Media is set to "First(Gallery2.Selected.Attachments).Value". This will obtain the attached file on the item selected on Gallery2.
My reason why this issue couldn't be resolved, because my company has 500+ employees, it’s hard for me to create a separate database for employee items with image as attachment. And it is double work, if the information is already existing somewhere, and I should utilize the existing information.