Added events tracking. Rewrite of how thumbnails are handled.