added automatic gallery creation