im trying to fetch some images dynamically that are stored in folders inside a folder using scandir function and it all works fine , but when i display the images using rest