more protection for zero-size images in thumbnail generation
more protection for zero-sized files