Several improvements on photo gallery, thumbs pre caching at upload