An image file is made up of two parts namely the file container and image data. The container is the common structure which uniquely defines JPEG image. If the container of a JPEG file is damaged or is corrupt then the software will not be able to identify the file as a JPEG file and you will get an "Invalid image" message. In case, the container of a JPEG file is intact but its image data is corrupt even then the will be able to repair the image. Such a repaired image will have defects like loss of color or a part of the image will be missing. These defects are due to image data being corrupt. In such situations, it is advised that you try and extract the thumbnail of the image (if any).