final PopupPanel imagePopup = new PopupPanel(true);
imagePopup.setAnimationEnabled(true);
for (int k = 0; k < result.size(); k++) {
PhotoModel photoModel = result.get(k);
FlexTable i_layout = new FlexTable();
i_layout.setCellSpacing(6);
FlexCellFormatter i_cellFormatter = i_layout.getFlexCellFormatter();
i_layout.setHTML(0, 0, photoModel.getTitle());
// add small image to flexTable
Image thumbImage = new Image(photoModel.getThumbURL());
i_cellFormatter.setColSpan(0, 0, 1);
i_cellFormatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
i_layout.setWidget(1, 0, thumbImage);
DecoratorPanel decPanel = new DecoratorPanel();
decPanel.setWidget(i_layout);
if (j >= 5) {
j = 0;
i++;
}
m_layout.setWidget(i, j++, decPanel);
// add full image popup windows for small image
imagePopup.setHeight(photoModel.getHeight() + "px");
imagePopup.setWidth(photoModel.getWidth() + "px");
final String fullImageURL = photoModel.getURL();
final Image fullImage = new Image();
thumbImage.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {