If you want to go fully random, try this.
Put them all in middle. Then add these expressions to size, respectively position:
dur = 3;
linear(time,inPoint, inPoint+dur,[0,0], [100,100])
seedRandom(index,true)
dur = 3;
cWidth = thisComp.width;
cHeight = thisComp.height;
rect = thisLayer.sourceRectAtTime(time,true);
thisWidth = rect.width;
thisHeight = rect.height;
outSide = Math.round(random());//Here we decide if it goes out vertically or horizontally
x = outSide == 0 ? Math.random() < 0.5 ? cWidth+thisWidth/2 : - thisWidth/2 : random(cWidth);
y = outSide == 1 ? Math.random() < 0.5 ?cHeight+thisHeight/2 : -thisHeight/2 : random(cHeight);
linear(time, inPoint, inPoint+dur,value,[x,y])
Set the dur variable to how much time you want them to travel.
Then set the duration for each layer, in the timeline, equal to what dur variable you chose.
Select all layers, right click, keyframe assistant>distribute layers. Check overlap only if you want them to overlap.
You should now have what you wanted.
Andrei
My Envato portfolio.