for (int i = 0; i < result.getItems().length; i++) {
uri = new ImageResourceURIImpl(site, null, result.getItems()[i].getId());
if (repository.exists(uri)) {
image = (ImageResource) repository.get(uri);
language = LanguageUtils.getPreferredLanguage(image, request, site);
image.switchTo(language);
imageContent = image.getContent(language);
linkToImage = UrlUtils.concat("/weblounge-images", image.getIdentifier(), imageContent.getFilename());
// Find the image style