input: Write a function to scrape photos and captions from a given website URL. The function should return a list of dictionaries where each dictionary contains the 'photo_url' and 'caption' (if available) of each photo. If the website URL is empty or cannot be accessed, return an empty list.
  
  
  def scrape_photos_and_captions(url):
      if not url:
          return []
      
      try:
          req = requests.get(url)
          if req.status_code != 200:
              return []
          html = req.text
      except requests.RequestException:
          return []
      
      soup = BeautifulSoup(html, features='lxml')
      image_divs = soup.find_all('div', {'class': 'image-gallery__image'})
      results = []
  
      for image_div in image_divs:
          figure = image_div.find('figure')
          src = figure.find('img')['src']
          caption = figure.find('figcaption')
          caption_text = caption.text if caption else None
          results.append({'photo_url': src, 'caption': caption_text})
  
      return results
  
  assert scrape_photos_and_captions('https://example.com/webpage') == [
      {'photo_url': 'https://example.com/image1.jpg', 'caption': 'First photo'},
      {'photo_url': 'https://example.com/image2.jpg', 'caption': None},
      {'photo_url': 'https://example.com/image3.jpg', 'caption': 'Third photo'}
  ]
  
  assert scrape_photos_and_captions('') == []
  assert scrape_photos_and_captions('https://nonexistenturl.com') == []
  
output: def scrape_photos_and_captions(url):
      if not url:
          return []
      
      try:
          req = requests.get(url)
          if req.status_code != 200:
              return []
          html = req.text
      except requests.RequestException:
          return []
      
      soup = BeautifulSoup(html, features='lxml')
      image_divs = soup.find_all('div', {'class': 'image-gallery__image'})
      results = []
  
      for image_div in image_divs:
          figure = image_div.find('figure')
          src = figure.find('img')['src']
          caption = figure.find('figcaption')
          caption_text = caption.text if caption else None
          results.append({'photo_url': src, 'caption': caption_text})
  
      return results