iPhoto Journal page auto adjustment around images
===

What javascript libraries / other programming tools would be needed to replicate what the iPhoto Journal does to your uploaded images?  iPhoto adjusts the page around whatever you are doing (if you add a picture, remove a picture, enter captions, etc.) which makes the journal look beautiful.

Here is the example link: 

https://www.icloud.com/journals/sample/

I understand that this question is really broad, so any answers that would help me refine my searches would be appreciated.