added default case for the situation where a directory doesn't have any image files