How to add an image to a theme page template in code?

Haven’t tested this, but the key is to use get_posts() with the proper arguments so as to retrieve the ids of the attachments, e.g.

   $args = array(
     'post_type' => 'attachment',
     'numberposts' => -1,
     'post_status' => null,
     'post_parent' => $post->ID
  );

  $attachments = get_posts( $args );
     if ( $attachments ) {
        foreach ( $attachments as $attachment ) {
           echo '<li>';
           the_attachment_link( $attachment->ID, true );
           echo '<p>';
           echo apply_filters( 'the_title', $attachment->post_title );
           echo '</p></li>';
          }
     }

See https://codex.wordpress.org/Function_Reference/get_attachment_link and https://codex.wordpress.org/Function_Reference/the_attachment_link.

As far as the image dimensions go, you probably want CSS for that, unless you just want to display the image as is.