Correctly skip over directories when rendering files