How to seggregate http session offline.

I have raw packets captured by sniffer. Now I am writing a program to seggregate all sub-sessions and main session.

In short how can I see a Home page with all pictures as i can see when connected to internet.

I am doing with "referer" and "cookies"... but not getting the logic..