I found this link today, it's an excellent read, and explains succinctly what I've been wanting to do with my photo library for ages.
Tetris & The Power Of CSS
'via Blog this'
Another good one, which I haven't got round to implementing yet is this:
The algorithm for a perfectly balanced photo gallery