What is the problem or limitation:
English Wikisource makes extensive use of scanned works. These are sourced from various locations including a large number that are hosted as scans by Internet Archive.
The current approach has been to use a provided djvu (or PDF) for this purpose, uploaded to Commons or English Wikisource, and in most situations this has sufficed for simple works.
However for some works (and scans) the quality of a PDF or djvu obtained is necessarily lower than the original scans (which are typically in a JPEG2000 format.) and this quality is affected by conversions between various formats in the toolchain (see T256848 T224355 for related issues.)
What is the functionality you would like:-
The ability to specify an IA style identifier in a suitable field on an Index: page, and regardless of a local file (PDF/DJVU) being hosted, have the back-end (such as ProofreadPage or Thumbor), pull the high quality JPEG2000 scan from an original on the IA server for the specified page on a dynamic basis, without the high quality scans needing to be hosted locally or on Commons, down converting the scan to conventional JPEG with minimal loss of quality as required. ( An image generated from a locally hosted PDF/DJVU would still be available as a fall-back.)
Archival links for the high quality page scans of a given work at IA are often of the form (example)
which looks like it could be generated from code, on a dynamic basis, assuming the relevant information can be obtained from an suitable page (such as a File: or Index:).
Having the highest quality scans available would also be useful for OCR purposes, where works do not necessarily contain a 'readable' text layer.
It should be noted that this is intended to be used only for works with reliable sourcing and licensing information, and which would otherwise be compatible if hosted locally on Commons/Wikisource.
An alternative approach would be to host the high quality scans on Commons directly, but that would need an automated task to identify and match existing uploaded DJVU and PDF, to their equivalent high quality scans at IA, and ensure the correctly paired scan-sets were matched up.