Fixing a bug when the photo browser is presented from a modal

And some project and code cleaning