If these are JPEGs with a grey or green lower half, it's likely only a few 16x16 macroblocks are corrupted and you can recover the rest.
This cannot be done programmatically because you have to guess what the average colour of the block was, but it can be worth it for precious pictures.