I cannot answer specifically for that theme as I am not familiar with it. But generally look for getPrevImageURL(), hasPrevImage(), getNextImageURL(), or hasNextImage() in the script. That is where these links will be being generated.
Your code above is HTML, so you will have to "escape" from PHP for it. This is done by inserting ?> before the code and `