input: Write a function to design a script in Python to scrape photos and captions from a given website using BeautifulSoup and requests libraries. The function should accept a URL as input, extract the HTML source code, and print the photo URLs and their respective captions if available. If no caption is found, it should print 'No caption'. The function should perform these steps:
  1. Get the HTML source code from the given URL.
  2. Parse the HTML source using BeautifulSoup.
  3. Find all image elements within specified divs.
  4. For each image element, print its URL and caption if available.
  
  def scrape_photos_and_captions(url):
      from bs4 import BeautifulSoup
      import requests
  
      # Get the HTML source code
      req = requests.get(url)
      html = req.text
  
      # Parse HTML source and extract photo and caption
      soup = BeautifulSoup(html, features='lxml')
      image_divs = soup.find_all('div', {'class': 'image-gallery__image'})
  
      for image_div in image_divs:
          figure = image_div.find('figure')
          src = figure.find('img')['src']
          caption = figure.find('figcaption')
          print('Photo: ', src)
          if caption:
              print('Caption: ', caption.text)
          else:
              print('No caption')
          print('\n')
  
  assert scrape_photos_and_captions('https://example.com/webpage') == None
output: def scrape_photos_and_captions(url):
      from bs4 import BeautifulSoup
      import requests
  
      # Get the HTML source code
      req = requests.get(url)
      html = req.text
  
      # Parse HTML source and extract photo and caption
      soup = BeautifulSoup(html, features='lxml')
      image_divs = soup.find_all('div', {'class': 'image-gallery__image'})
  
      for image_div in image_divs:
          figure = image_div.find('figure')
          src = figure.find('img')['src']
          caption = figure.find('figcaption')
          print('Photo: ', src)
          if caption:
              print('Caption: ', caption.text)
          else:
              print('No caption')
          print('\n')