func (l *client) ListImages(filter string) ([]Image, error) {
	response := []Image{}
	imglist, err := l.server.GetImages()
	if err != nil {
		return nil, fmt.Errorf("unable to list images: %w", err)
	}
	for _, imgInfo := range imglist {
		if filter != "" && filter != imgInfo.Fingerprint {
			continue
		}
		aliases := []string{}
		for _, ali := range imgInfo.Aliases {
			aliases = append(aliases, ali.Name+":latest")
		}
		response = append(response, Image{
			Hash:    imgInfo.Fingerprint,
			Aliases: aliases,
			Size:    imgInfo.Size,
		})
	}
	return response, nil
}
ListImages will list all local images from the lxd server
package lxf  
import (
	"fmt"
	"regexp"
	"strings"
	"time"
	"github.com/automaticserver/lxe/shared"
	lxd "github.com/lxc/lxd/client"
	lxdApi "github.com/lxc/lxd/shared/api"
)
type Image struct {
	Hash    string
	Aliases []string
	Size    int64
}
func (l *client) PullImage(name string) (string, error) {
	imageID, err := l.parseImage(name)
	if err != nil {
		return "", err
	}
	imgServer, err := l.config.GetImageServer(imageID.Remote)
	if err != nil {
		return "", err
	}
	imageRef := dereferenceAlias(imgServer, imageID.Alias)
	image, _, err := imgServer.GetImage(imageRef)
	if err != nil {
		return "", err
	}
	args := lxd.ImageCopyArgs{
		CopyAliases: false,  
		AutoUpdate:  true,   
	}
	err = l.opwait.CopyImage(imgServer, *image, &args)
	if err != nil {
		return "", fmt.Errorf("unable to pull requested image %v from server %v, %w",
			image, imageID.Remote, err)
	}
	return image.Fingerprint, l.ensureImageAlias(imageID.Tag(), image.Fingerprint)
}
func (l *client) RemoveImage(name string) error {
	imageID, err := l.parseImage(name)
	if err != nil {
		return err
	}
	hash, found, err := imageID.Hash(l)
	if err != nil {
		return err
	} else if !found {
		return nil
	}
	err = l.opwait.DeleteImage(hash)
	if err != nil {
		if shared.IsErrNotFound(err) {
			return nil
		}
		return err
	}
	return nil
}
func (l *client) ensureImageAlias(alias string, fingerprint string) error {
	current, err := l.server.GetImageAliases()
	if err != nil {
		return err
	}
	alreadyCorrect := false
	for _, ca := range current {
		if ca.Name == alias {
			if ca.Target == fingerprint {
				alreadyCorrect = true
				break
			}
			err = l.server.DeleteImageAlias(ca.Name)
			if err != nil {
				return fmt.Errorf("failed to delete alias for update: %v, %w", alias, err)
			}
		}
	}
	if alreadyCorrect {
		return nil
	}
	aliasPost := lxdApi.ImageAliasesPost{}
	aliasPost.Name = alias
	aliasPost.Target = fingerprint
	err = l.server.CreateImageAlias(aliasPost)
	if err != nil {
		return fmt.Errorf("failed to create alias: %v, %w", alias, err)
	}
	return nil
}