This is a little out of my lane, but here's what I'd do. First create a comp that has all your imagery (white against transparent background) and call it "bg". Then create another comp (same size as "bg") and drag "bg" into it as the bottom layer. Then create a shape layer using the menu command Layer > New > Shape Layer. Twirl the shape layer open and do this: Add > Rectangle, and then Add > Fill. For the shape's Transform > Position property, add this expression:
nCols = 10;
nRows = 20;
w = Math.round(thisComp.width/nCols);
h = Math.round(thisComp.height/nRows);
col = (index-1)%nCols;
row = Math.floor((index-1)/nCols);
[w,h]/2 + [col*w,row*h]
For the shape's Contents > Rectangle Path > Size property, add this expression:
nCols = 10;
nRows = 20;
w = Math.round(thisComp.width/nCols);
h = Math.round(thisComp.height/nRows);
minH = .05;
maxH = .95;
s = thisComp.layer("bg").sampleImage(position,[w,h]/2,false,time)[3];
hPct = linear(s,0,1,minH,maxH);
[w,h*hPct]
Duplicate the shape layer enough times to fill the comp. You should end up with a 10x20 grid of self-positioning, self-sizing rectangles that react to imagery in the "bg" comp layer. You may want to add a comp-sized solid layer between the "bg" layer and the bottom-most shape layer to provide the background fill color. That should get you started.
... View more