The sample template below was created to answer a request for a layout showing images in a unique layout as shown in the comments in the code. The template was tested using the TwentyTen theme. The template is not meant to be used as-is – it is meant to be only a guide to the logic needed to produce the layout.
Here is a screen shot of the results:
and here is the code: