JS: loop through array with two different functions
===

I have a JS array `imgs[]`.

the array holds image-paths like this: `["img/image1.png", "img/image2.png"]`

I have two functions 


    function prev() {
    	$('#project-image').html("<img src='"+imgs[0]+"' alt='Projekt'/>")
    }
    	
    function next() {
    	$('#project-image').html("<img src='"+imgs[1]+"' alt='Projekt'/>")
    }


they are called within html like this

    <nav id="pagination">
    		<a id="prev" href="javascript:prev();"></a>
    		<a id="next" href="javascript:next();"></a>
    	</nav>

However the problem I have is that right now set to fixed keys within the array (hardcoded by me) - like `imgs[1]`

I wonder how I could dynamicall loop through all images in the array with those two functions?

When clicking the "next" link I want to load the next image in the array, when clicking the "prev" link I want to load the prev image. My array consists mostly of more than two images and moreover they are not all named like the example above. So the names of the images vary.

Any ideas how to that?