Small fixes in layout. Added dirty thumbnails cache.