[eluser]Aken[/eluser]
First, if you have a block of commented code, just remove it. All it does is bloat the file.
Your code isn't that awful, just has a lot of opening / closing PHP. I would iterate through your array in the controller first, and move the counter and base_url() logic there. Also, if your gallery link won't change, you can define it once instead of calling base_url() over and over (more a performance issue than how nice it looks).
Also, base_url() accepts a string that's appended to the URL. It looks cleaner, IMO:
Code:
echo base_url() . 'images/events/' . $image['photo']; ?>_square.jpg
// Compared to:
echo base_url('images/events/' . $image['photo'] . '_square.jpg');