code: public static CmsGalleryDataBean getInitialSettings(HttpServletRequest request, CmsGalleryConfiguration config)
      throws CmsRpcException {
  
          CmsGalleryService srv = new CmsGalleryService();
          srv.setCms(CmsFlexController.getCmsObject(request));
          srv.setRequest(request);
          CmsGalleryDataBean result = null;
          try {
              result = srv.getInitialSettings(config);
          } finally {
              srv.clearThreadStorage();
          }
          return result;
      }
docs: Returns the initial gallery settings.<p>
  
  @param request the current request
  @param config the gallery configuration
  
  @return the initial gallery settings
  
  @throws CmsRpcException if something goes wrong