Support loading overridden images. Fix a few bugs.