added caching and functionality for posting pictures