# EPUBCheck MED-004: image header looks damaged, how to fix it

Source: https://epubcc.com/epubcheck/med-004/ (updated 2026-11-04)

EPUBCheck MED-004 is an error message: “Image file header may be corrupted.” An image file's header looks damaged, so the image may not display. EPUBCheck reads the first bytes of each image to check its format and size, and here they do not make sense.

- Official message (EPUBCheck 5.4.0): Image file header may be corrupted.
- Default severity: Error

## Typical causes

- An image truncated in a copy, a download or a failed ZIP operation.
- An image saved by a faulty tool, or a file whose extension does not match its content.

## How to fix it

1. Open the image in an image viewer: if it fails or shows only part of the picture, it is damaged.
2. Re-export the image from its source and replace the file, keeping the same name or updating every reference to it.
3. Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.

## When it's not this

If the image cannot be decoded at all, EPUBCheck reports PKG-021; a wrong extension is PKG-022.

## Sources

- EPUB 3.3, §3.2 Core media types: https://www.w3.org/TR/epub-33/#sec-core-media-types (read 2026-11-04)

Message text and severity: EPUBCheck (W3C, BSD-3-Clause). Explanation: EpubCC.
