Get all the folders that contain media files

This set of functions will help you to get all the folders that contain media files. Empty folders are not listed.