fix creating thumbnail using promise