on-the-fly image manipulation and caching