code: public void onContentChange() {
  
          Scheduler.get().scheduleDeferred(new ScheduledCommand() {
  
              public void execute() {
  
                  Widget parent = getParent();
                  while (parent != null) {
                      if (parent instanceof CmsGalleryDialog) {
                          ((CmsGalleryDialog)parent).updateSizes();
                          parent = null;
                      } else {
                          parent = parent.getParent();
                      }
                  }
              }
          });
      }
docs: Call on content change to update the layout.<p>