How is the image sent back to the front end

I’ve isolated the piece of code that returns the image (from strapi-plugin-upload/middlewares/upload/index.js):

    strapi.router.get(
      '/uploads/(.*)',
      range,
      koaStatic(staticDir, { defer: true, ...localServerConfig })
    );

Can anyone explain what range does? If i console.log it, it returns an object containing request, response (with a status of 404 and message ‘not found’…)

Also, taking away koaStatic does not seem to have any effect on the returned image.

My objective is to manipulate the Buffer until the correct format is sent back. Any idea?