Separate all layers every "X" interval of time in After Effects
No scripting or expressions are needed, it's built-in to After Effects:


Drop all your frames into a comp… 
go to the 5 second mark…
with all layers selected, hit alt] or option] to trim the end of the layer to the current time…
still with all the layers selected either right-click or go to the top menu and choose Animation>Keyframe Assitant>Sequence Layers…
in the dialog that comes up you can choose to overlap the layers and to add dissolves. Usually for a slideshow you will choose to dissolve the top layer only. Dissolving top and bottom layers mean that the background shows through in the middle of the dissolve.