All these functions are in includes/album_mod/album_hierarchy_functions.php, you can try to look through album code to check how these functions are used so you can create a list of all subcategories and finally with a single SQL obtain all pictures from them.