This is what I'm looking at, there are photos in each of those folders.If without a Terminal and other side is a Mac then easiest way for me is to copy folders and it's content on a Mac, then in Finder click on this button (top middle side of a window; will change view type)
View attachment 2097422
from there you can quickly expand folders and drag items from there
You may try with Spotlight search: just move photos and subfolders to a separate folder –> then press Command + F + . at the same time –> select any file type – Image
Worked perfect, thank you!Select the iCloud folders, right-click - New Folder with Selection, open that newly created folder with all the subfolders and use Finder’s search field to find all the images, select them all and copy/move them where you want.
New Folder with Selection https://support.apple.com/guide/mac-help/organize-files-using-folders-mh26885/mac
Narrow your search results on Mac https://support.apple.com/guide/mac-help/narrow-search-results-mh15155/mac