MODE-1768 Added checks to include only existing and readable files as child nodes

Should be merged onto the '3.1.x' branch and cherry-picked onto the 'master' branch.