I am searching for files of a certain type in a folder. Once found they are copied to a target folder. The files I want to find are deep in several layers of folders and subfolders. I can find the folders and copy them, along with all the subfolders, but what I want to copy are just the files, without their ancestors (layers of parent files).
I expect this is a common enough request that the feature exists, but I can't find it.

I want to search the Sample directory in the above screen grab and find only the JPEG images then copy them to a target directory.