Fixes speed issue when opening large directories
Fixes speed issue when opening large directories

This was necessary due to large directories with excessive 
subdirectories

Signed-off-by: Andreas Heigl <andreas@heigl.org>
heiglandreas/gallery,heiglandreas/gallery