code: public void getImageAttributes(
          final Map<String, String> attributes,
          final I_CmsSimpleCallback<Map<String, String>> callback) {
  
          boolean requiresLink = false;
  
          for (Entry<Attribute, I_CmsFormWidget> entry : m_fields.entrySet()) {
              String val = entry.getValue().getFormValueAsString();
              if (CmsStringUtil.isEmptyOrWhitespaceOnly(val)) {
                  continue;
              }
              if (entry.getKey() == Attribute.linkPath) {
                  requiresLink = true;
              } else {
                  attributes.put(entry.getKey().name(), val);
              }
          }
          if (requiresLink) {
              CmsCoreProvider.get().substituteLinkForRootPath(
                  m_fields.get(Attribute.linkPath).getFormValueAsString(),
                  new I_CmsSimpleCallback<String>() {
  
                      public void execute(String arg) {
  
                          attributes.put(Attribute.linkPath.name(), arg);
                          callback.execute(attributes);
                      }
                  });
          } else {
              callback.execute(attributes);
          }
      }
docs: Adds necessary attributes to the map.<p>
  
  @param attributes the attribute map
  @param callback the callback to execute