bugfix: call initImage() only if defined