There’s basically three things that can be wrong if a JPEG opens but is partially grey:
1. File is too small. Let’s an average JPEG shot with same camera and settings is 4 MB and the ones that are damaged are like 1 MB or 2 MB. Then probably half the data is simply missing. These files can not be repaired.
2. Normal file size. Either part of the file does not contain image data or file does contain image data but is interrupted by some invalid data.
If part of the file does not contain image data then this is sometimes easy to spot using a hex editor. All of a sudden ‘random’ binary data stops and changes to FF FF FF or 00 00 00 etc.. Repair: Impossible.
In case the data is however is there but it is interrupted repair is often possible. JPG-Repair tries to detect and will try to get rid of the invalid data, however this does not always work. Current version detects invalid JPEG markers, common damage due to bad sectors and some type of corruption I observed a few times with images shot with certain Samsung phones.