lfs_generate_products: avoid IOError: image file is truncated