correct callback + possibility to store document thumbnail