Adding animation and caching to images