added photo upload and download functionality