def get_images(img_type)
      images = Hash.new

      if img_type == "OSImage"
        response = @connection.query_azure("images")
      elsif img_type == "VMImage"
        response = @connection.query_azure("vmimages")
      end

      unless response.to_s.empty?
        osimages = response.css(img_type)

        osimages.each do |image|
          item = Image.new(image)
          images[item.name] = item
        end
      end

      images
    end
def get_images(img_type)
      images = Hash.new

      if img_type == "OSImage"
        response = @connection.query_azure("images")
      elsif img_type == "VMImage"
        response = @connection.query_azure("vmimages")
      end

      unless response.to_s.empty?
        osimages = response.css(img_type)

        osimages.each do |image|
          item = Image.new(image)
          images[item.name] = item
        end
      end

      images
    end
img_type = OSImages or VMImage