generate thumbnail directly from image object