lfs_generate_products: avoid IOError: image file is truncated
Merge pull request #124 from xentry/master

lfs_generate_products: avoid IOError: image file is truncated