Access Library Images via a Custom Module

I wish to access images stored in the library via a custom module, so the user can pick images when editing the module in the layout designer. Could you give me a little help about how to access the library files? I guess it can be done with the edit.twig file? Right now I pass in resources statically using the modules install PHP script.

Another solution would be using an image dataset. It works - but is not the most practical solution for me. The best workflow is if one would be able to select images directly by e.g. a dropdown menu via the „Edit Module“ box in the layout designer.

Thanks in advance,