updated photo gallery functions