Fix possible crash generating thumbnail for drag.