added node caching with toImage, see #4