keep track of depth (and, so, image_nvals).