You are getting a directory listing because that's all you are really doing, listing the directory.
So yes, some code to tell the browser how you want the content in the directory to be displayed.
Install a Nextcloud server.
https://nextcloud.com/
It's open source and has interface apps / cross platform clients for mobile and such.