Map<String, String> largeMap = UtilMisc.toMap("size", "large", "productId", productId);
Map<String, String> detailMap = UtilMisc.toMap("size", "detail", "productId", productId);
if ("Y".equals(product.getString("isVirtual"))) {
// find the first variant, use it's ID for the names...
List<GenericValue> productAssocList = EntityUtil.filterByDate(delegator.findByAnd("ProductAssoc", UtilMisc.toMap("productId", productId, "productAssocTypeId", "PRODUCT_VARIANT")));
if (productAssocList.size() > 0) {
GenericValue productAssoc = EntityUtil.getFirst(productAssocList);
smallMap.put("productId", productAssoc.getString("productIdTo"));
mediumMap.put("productId", productAssoc.getString("productIdTo"));
product.set("smallImageUrl", FlexibleStringExpander.expandString(pattern, smallMap));