docs: @SuppressWarnings("deprecation")
      private List<CmsGalleryType> collectGalleryTypes() {
  
          Locale wpLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject());
          Map<String, List<String>> galleryContentTypes = new HashMap<String, List<String>>();
          List<CmsGalleryType> result = new ArrayList<CmsGalleryType>();
          for (I_CmsResourceType resourceType : OpenCms.getResourceManager().getResourceTypes()) {
              if (resourceType instanceof CmsResourceTypeFolderExtended) {
                  // found a configured extended folder resource type
                  CmsResourceTypeFolderExtended galleryType = (CmsResourceTypeFolderExtended)resourceType;
                  String folderClassName = galleryType.getFolderClassName();
                  if (CmsStringUtil.isNotEmpty(folderClassName)) {
                      // only process this as a gallery if the folder name is not empty
                      try {
                          // check, if the folder class is a subclass of A_CmsGallery
                          if (A_CmsAjaxGallery.class.isAssignableFrom(Class.forName(folderClassName))) {
                              CmsGalleryType gallery = new CmsGalleryType();
                              gallery.setTypeId(resourceType.getTypeId());
                              gallery.setResourceType(resourceType.getTypeName());
                              gallery.setTitle(
                                  CmsWorkplaceMessages.getResourceTypeName(wpLocale, resourceType.getTypeName()));
                              gallery.setSubTitle(
                                  CmsWorkplaceMessages.getResourceTypeDescription(wpLocale, resourceType.getTypeName()));
                              gallery.setBigIconClasses(
                                  CmsIconUtil.getIconClasses(resourceType.getTypeName(), null, false));
                              result.add(gallery);
                          }
                      } catch (Exception e) {
                          this.log(e.getLocalizedMessage(), e);
                      }
                  }
              } else {
                  List<I_CmsResourceType> galleryTypes = resourceType.getGalleryTypes();
                  if ((galleryTypes != null) && !galleryTypes.isEmpty()) {
                      for (I_CmsResourceType galleryType : galleryTypes) {
                          List<String> typeList = galleryContentTypes.get(galleryType.getTypeName());
                          if (typeList == null) {
                              typeList = new ArrayList<String>();
                              galleryContentTypes.put(galleryType.getTypeName(), typeList);
                          }
                          typeList.add(resourceType.getTypeName());
                      }
                  }
              }
          }
          for (CmsGalleryType galleryType : result) {
              galleryType.setContentTypeNames(galleryContentTypes.get(galleryType.getResourceType()));
          }
          return result;
      }