#852 resize thumbnail if image is 0 byte length

was raised as issue #852