img2: return AVERROR(EINVAL) in case of invalid filename pattern