"autop" is quite a handy (PHP) utility to convert newlines into a valid (html-)paragraph. This is way beyond my own skills in PHP...
The photo matt site is impressive, in both functionality and design. Good use of CSS too.