Add caching support for images/profiles. Fix bugs.