Fix bug in photo gallery