public void addThumbnail(AddedNodeFact imageNode, String name, int size,boolean square, KnowledgeHelper drools) throws Exception {
if (imageNode.getNode().hasNode(name)) {
JCRNodeWrapper node = imageNode.getNode().getNode(name);
Calendar thumbDate = node.getProperty("jcr:lastModified").getDate();
Calendar contentDate = imageNode.getNode().getNode("jcr:content").getProperty("jcr:lastModified").getDate();
if (contentDate.after(thumbDate)) {
AddedNodeFact thumbNode = new AddedNodeFact(node);
File f = getThumbFile(imageNode, size,square, drools);
drools.insert(new ChangedPropertyFact(thumbNode, Constants.JCR_DATA, f, drools));
drools.insert(new ChangedPropertyFact(thumbNode, Constants.JCR_LASTMODIFIED, new GregorianCalendar(), drools));
}