Improve support for cross-toolkit images

Allow specifying an image loader callback. Secondary toolkits will use it to
load images on demand.