Get Media/Image Attribute list from given Attribute set Magento 2.

You can fetch a list of image attribute from the current attribute set using Magento 2.

If you want to know about all the image attribute created for the given attribute set, You can find out all the image attributes for an attribute set.

Retrieve the list of media/image attributes whose fronted input type is media_image assigned to the given attribute set using below way.

<?php
namespace Path\To\Class;

use Magento\Catalog\Api\ProductMediaAttributeManagementInterface;

class MediaAttribute
{
    /**
     * @var ProductMediaAttributeManagementInterface
     */
    private $mediaAttribute;

    public function __construct(
        ProductMediaAttributeManagementInterface $mediaAttribute
    ) {
        $this->mediaAttribute = $mediaAttribute;
    }

    public function getImagesAttribute()
    {
    	$attributeSet = 'default'; //attribute set name
        $mediaAttributeList = $this->mediaAttribute->getList($attributeSet);
        return $mediaAttributeList;
    }

You need to iterate a loop over return value of a function,

foreach ($mediaAttributeList as $attributeId => $value) {
    echo $attributeId .'=>'. $value->getData('attribute_code');
}

Output:

87 => image
88 => small_image
175 => swatch_image
89 => thumbnail