Fix possible NPE if object not loaded.

Fix possible NPE when generating projected image
To test

 * Import a lsm image with multiple z
 * Project the image.
 * A thumbnail should be generated.
not application-internal