result.put("contentFrameId", contentId);
result.put("contentId", (String) context.get("contentId"));
result.put("dataResourceId", (String) context.get("dataResourceId"));
// File to use for original image
FlexibleStringExpander filenameExpander = FlexibleStringExpander.getInstance(imageFilenameFormat);
String fileLocation = filenameExpander.expandString(UtilMisc.toMap("location", "products", "type", sizeType, "id", contentId));
String filenameToUse = fileLocation;
if (fileLocation.lastIndexOf("/") != -1) {
filenameToUse = fileLocation.substring(fileLocation.lastIndexOf("/") + 1);
}