I ended up using https://github.com/victornpb/eleventy-plugin-page-assets to copy the images. It gives new names to each image and rewrites the img src attribute accordingly, but I can live with that. I suppose it also wouldn't be a good solution if I had multiple input files link to the same image, because the image would be copied to each output folder, but luckily that's not a problem in my specific case.