I ran this in B3D demo, set model to load - everything worked, so I tried to take screenshot. I've pressed enter key and script has crashed. Debug has marked this line:
Anyway I found way how to get it without pressing enter key - I removed line, that places left-top preview square, set window size to 160x160, and took it by PrintScrn key. Then just pasted to bitmap and set size to 40x40. But thanks