title: Correct way of using wp_get_attachment_image() in wordpress
body: <p>I'm looking for the correct way of using wp_get_attachment_image().</p>
  
  <p>The following code:</p>
  
  <pre><code>&lt;?php
      $args = array(
          'type' =&gt; 'attachment',
          'category_name' =&gt; 'portfolio'
          );
      $attachments = get_posts($args);
      print_r($attachments);
  ?&gt;
  </code></pre>
  
  <p>Generates the following result:</p>
  
  <pre><code>Array
  (
      [0] =&gt; stdClass Object
          (
              [ID] =&gt; 54
              [post_author] =&gt; 1
              [post_date] =&gt; 2010-06-22 00:32:46
              [post_date_gmt] =&gt; 2010-06-22 00:32:46
              [post_content] =&gt; &lt;a href="http://localhost/wordpress/wp-content/uploads/2010/06/Capture.jpg"&gt;&lt;img class="alignnone size-medium wp-image-55" title="Capture" src="http://localhost/wordpress/wp-content/uploads/2010/06/Capture-300x114.jpg" alt="" width="300" height="114" /&gt;&lt;/a&gt; 
              [post_title] =&gt; Our Own Site
              [post_excerpt] =&gt; 
              [post_status] =&gt; publish
              [comment_status] =&gt; open
              [ping_status] =&gt; open
              [post_password] =&gt; 
              [post_name] =&gt; our-own-site
              [to_ping] =&gt; 
              [pinged] =&gt; 
              [post_modified] =&gt; 2010-06-22 00:40:22
              [post_modified_gmt] =&gt; 2010-06-22 00:40:22
              [post_content_filtered] =&gt; 
              [post_parent] =&gt; 0
              [guid] =&gt; http://localhost/wordpress/?p=54
              [menu_order] =&gt; 0
              [post_type] =&gt; post
              [post_mime_type] =&gt; 
              [comment_count] =&gt; 0
              [filter] =&gt; raw
          )
  )
  </code></pre>
  
  <p>The following, however, doesn't return anything.</p>
  
  <pre><code>&lt;?php
      echo wp_get_attachment_image(54, array('300', '300'));
  ?&gt;
  </code></pre>
  
  <p>What am I doing wrong here?</p>