Fixed: check image is intact before loading it; reported by @wangjiezhe
Merge remote-tracking branch 'upstream/master'