add new file above summary if it is the first file in the list

If you add a new file to a directory which contains only other directories but no files than the new file was placed below the summary. This patch fixes it.

cc @Kondou-ger