Fully working version of photo management