Added storing of overall image width and height and now throws an exception when a critical key is missing from the metadata dictionary.