Add link to image title (watch for <%=) and change interator to use index. Also convert the index to an integer.