fixes creation of galleries in subdirectories