Added dynamic image resizing and caching