support for externally allocated image memory