# EPUBCheck PKG-022: image extension mismatch, how to fix it

Source: https://epubcc.com/epubcheck/pkg-022/ (updated 2026-11-04)

EPUBCheck PKG-022 is a warning message: “Wrong file extension for image. The image is a "…" file but has the file extension "…".” An image's extension does not match its real format, for example a PNG file named .jpg. Most reading apps still show it, but tools that trust the extension or the manifest media type can fail.

- Official message (EPUBCheck 5.4.0): Wrong file extension for image. The image is a "%1$s" file but has the file extension "%2$s".
- Default severity: Warning

## Typical causes

- Images renamed instead of converted.
- Tools that save in one format but keep the old extension.

## How to fix it

1. Either rename the file to the right extension or convert it to the format its name says.
2. Make the manifest media type match the real format too (image/png, image/jpeg…).
3. After renaming, update every reference to the file: the manifest in the package document, links and image sources in the XHTML, and url() references in the CSS.

## When it's not this

If the image cannot be decoded at all, the message is PKG-021.

## Sources

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

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