<?xml version="1.0"?>
<DescribeImagesResponse xmlns="http://ec2.amazonaws.com/doc/<%=erb_version%>/">
   <requestId><%= @request_id %></requestId>
    <imagesSet>
        <% impool.each do |im| %>
            <% if (state_image = im.render_state) && im.ec2_ami? %>
            <item>
                <name><%= im['NAME'] %></name>
                <% if im['TEMPLATE/DESCRIPTION'] %>
                <description><%= im['TEMPLATE/DESCRIPTION'] %></description>
                <% end %>
                <% if im['TEMPLATE/PLATFORM'] %>
                <platform><%= im['TEMPLATE/PLATFORM'] %></platform>
                <% end %>
                <imageId><%= im.ec2_id %></imageId>
                <imageLocation><%= im['SOURCE'].split('/').last %></imageLocation>
                <imageState><%= state_image %></imageState>
                <imageOwnerId><%= im['UNAME'] %></imageOwnerId>
                <isPublic><%= im.public? ? "true" : "false" %></isPublic>
                <architecture>i386</architecture>
                <imageType>machine</imageType>
            </item>
            <% else
                next
            end
        end %>
    </imagesSet>
</DescribeImagesResponse>
