func GetImagesByTag(region, key, value string, available bool) (Images, error) {
	imgList := new(Images)
	sess := session.Must(session.NewSession(&aws.Config{Region: aws.String(region)}))
	svc := ec2.New(sess)
	params := &ec2.DescribeImagesInput{
		Owners: []*string{aws.String("self")},
		Filters: []*ec2.Filter{
			{
				Name: aws.String("tag:" + key),
				Values: []*string{
					aws.String(value),
				},
			},
		},
	}
	result, err := svc.DescribeImages(params)
	img := make(Images, len(result.Images))
	for i, image := range result.Images {
		img[i].Marshal(image, region)
	}
	if available {
		for i, _ := range img {
			if img[i].State == "available" {
				*imgList = append(*imgList, img[i])
			}
		}
	} else {
		*imgList = append(*imgList, img[:]...)
	}
	return *imgList, err
}
GetImagesByTag returns a slice of Amazon Machine Images given the provided region, and tag key/values
package aws
import (
	"errors"
	"fmt"
	"os"
	"reflect"
	"regexp"
	"sort"
	"sync"
	"time"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/ec2"
	"github.com/murdinc/awsm/aws/regions"
	"github.com/murdinc/awsm/config"
	"github.com/murdinc/awsm/models"
	"github.com/murdinc/terminal"
	"github.com/olekukonko/tablewriter"
)
type Images []Image
type Image models.Image
func (i *Images) GetImageName(id string) string {
	for _, img := range *i {
		if img.ImageID == id && img.Name != "" {
			return img.Name
		} else if img.ImageID == id {
			return id
		}
	}
	return id
}