Corrects conditional checking for instack_images defined

Change-Id: If90d639af6377c589c1ac3b254ec69c1d7d6b9e0