Imported old code for implementing the IIIF Image API and started adaptation for version 2.0