Added boolean arguments for non-raster registerGraph
extracted method: flattenImage.  changed cache naming