class AzureManagedImageService {

    public Optional<VirtualMachineCustomImage> findVirtualMachineCustomImage(String resourceGroup, String imageName, AzureClient client) {
        VirtualMachineCustomImage image = findImage(resourceGroup, imageName, client);
        if (image != null) {
            LOGGER.debug("Custom image {} is present in resource group {}", imageName, resourceGroup);
            return Optional.of(image);
        } else {
            LOGGER.debug("Custom image {} is not present in resource group {}", imageName, resourceGroup);
            return Optional.empty();
        }
    }

}