Single Image Gallery Post [closed]

Read Theme Unit Test and import the test data (including images!) into a new blog. You will get everything you need to test.

There is a gallery post included (Images Test), and if you click on an image you get an attachment page for this gallery image.

Here is a screen shot from TwentyEleven:

enter image description here

See the links in the upper right corner? Look into the source code of TwentyEleven to understand how they are implemented.
Use previous_image_link() and next_image_link().

<span class="nav-previous"><?php 
    previous_image_link( false, __( '&larr; Previous' , 'twentyeleven' ) ); 
?></span>
<span class="nav-next"><?php 
    next_image_link( false, __( 'Next &rarr;' , 'twentyeleven' ) ); 
?></span>

error code: 523