Support auto-rotation of images based on exif attributes

Local images will be rotated based on camera exif.
Also, local images will be saved to in-memory cache.