image.setImageMode(imageMode);
imageRenderer.setImage(image);
imageRenderer.setInset(convert.insetSizeValue(attributes.get("inset"), image.getHeight()));
Size imageDimension = imageMode.getImageNativeSize(image);
if (element.getConstraintWidth() == null) {
element.setConstraintWidth(convert.sizeValue(imageDimension.getWidth() + "px"));
}
if (element.getConstraintHeight() == null) {
element.setConstraintHeight(convert.sizeValue(imageDimension.getHeight() + "px"));
}
}