Improve algorithm of caching images.
Register status to db from events.