Background task for purging image cache. Minor code refactoring. #75