refactored and gallery opens images of current direcotry by default