This is the Resource interface:
https://github.com/gohugoio/hugo/blob/master/resource/resource.go#L48
The error you get indicates that it is not detected as an image. We detect the type by its MIME type derived from it’s extension (e.g. “image/png” => an image!).
You can check this by printing (or adding a conditional) .ResourceType
.
This is probably a filename issue.