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 a URL of the photo and its corresponding caption. If the caption is not present, the dictionary should contain None as the caption.
  import requests
  from bs4 import BeautifulSoup
  
  def scrape_photos_and_captions(url):
      req = requests.get(url)
      html = req.text
      soup = BeautifulSoup(html, features='lxml')
      image_divs = soup.find_all('div', {'class': 'image-gallery__image'})
      result = []
      for image_div in image_divs:
          figure = image_div.find('figure')
          img_src = figure.find('img')['src']
          caption = figure.find('figcaption')
          caption_text = caption.text if caption else None
          result.append({'photo_url': img_src, 'caption': caption_text})
      return result
  
  assert scrape_photos_and_captions('https://example.com/webpage1') == [{'photo_url': 'https://example.com/image1.jpg', 'caption': 'Caption for Image 1'}, {'photo_url': 'https://example.com/image2.jpg', 'caption': None}]
  assert scrape_photos_and_captions('https://example.com/webpage2') == [{'photo_url': 'https://example.com/image3.jpg', 'caption': 'Another Caption'}, {'photo_url': 'https://example.com/image4.jpg', 'caption': 'Yet Another Caption'}]
  assert scrape_photos_and_captions('https://example.com/webpage3') == []
  assert scrape_photos_and_captions('https://example.com/webpage4') == [{'photo_url': 'https://example.com/image5.jpg', 'caption': 'A Different Caption'}, {'photo_url': 'https://example.com/image6.jpg', 'caption': None}]
output: 
  def scrape_photos_and_captions(url):
      req = requests.get(url)
      html = req.text
      soup = BeautifulSoup(html, features='lxml')
      image_divs = soup.find_all('div', {'class': 'image-gallery__image'})
      result = []
      for image_div in image_divs:
          figure = image_div.find('figure')
          img_src = figure.find('img')['src']
          caption = figure.find('figcaption')
          caption_text = caption.text if caption else None
          result.append({'photo_url': img_src, 'caption': caption_text})
      return result
  