add(legendContainer);
legend = new Image("legend");
legendContainer.add(legend);
legend.setVisible(false);
legend.setOutputMarkupId(true);
legend.setImageResource(new DynamicWebResource() {
@Override
protected ResourceState getResourceState() {
return new ResourceState() {