GenericValue imageDataResource = delegator.findByPrimaryKey("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId));
//Debug.logVerbose("in createLayoutImage, imageDataResource(0):" + imageDataResource, module);
if (imageDataResource == null) {
imageDataResource = delegator.makeValue("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId));
imageDataResource.set("imageData", byteWrap.array());
imageDataResource.create();
} else {
imageDataResource.set("imageData", byteWrap.array());
imageDataResource.store();
}
} catch (GenericEntityException e3) {