do what laurie said, it makes the most sense. I was going to suggest the sampler info approach but would have had to work out exactly how to do it with the layer node... I'm still learning.