Generate thumbnails for documents.