<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extract_images(bs4, lazy_image_attribute=None):
 """If lazy attribute is supplied, find image url on that attribute :param bs4: :param lazy_image_attribute: :return: """


    # get images form 'img' tags
    if lazy_image_attribute:

        images = [image[lazy_image_attribute] for image in bs4.select('img') if image.has_attr(lazy_image_attribute)]

    else:

        images = [image['src'] for image in bs4.select('img') if image.has_attr('src')]

    # get images from detected links
    image_links = [link for link in extract_links(bs4) if link.endswith(('.jpg', '.JPG', '.png', '.PNG', '.gif', '.GIF'))]

    # get images from meta content
    image_metas = [meta['content'] for meta in extract_metas(bs4)
                   if 'content' in meta
                   if meta['content'].endswith(('.jpg', '.JPG', '.png', '.PNG', '.gif', '.GIF'))]

    return list(set(images + image_links + image_metas))