HI guys, I was reading some tutorial about a crossfading gallery, and I am having a few problems understanding it

Here's the code.
HTML (just the relevant bits)

Code:
```...
<div id="photos">
<img alt="Glendatronix" src="../../images/glenda_200.jpg" />
<img alt="Beau Dandy" src="../../images/beau_200.jpg" />
<img alt="Johnny Stardust" src="../../images/johnny_200.jpg" />
<img alt="Mo' Fat" src="../../images/mofat_200.jpg" />
</div>
...```
CSS

Code:
```#photos img {
position: absolute;
}
#photos {
width: 180px;
height: 200px;
overflow: hidden;
}```
SCRIPT

Code:
```\$(document).ready(function(){
rotatePics(1);
});
function rotatePics(currentPhoto) {
var numberOfPhotos = \$('#photos img').length;
currentPhoto = currentPhoto % numberOfPhotos;
// re-order the z-index
\$('#photos img').each(function(i) {
\$(this).css(
'zIndex', ((numberOfPhotos - i) + currentPhoto) % numberOfPhotos
);
});
\$(this).show();
setTimeout(function() {rotatePics(++currentPhoto);}, 4000);
});
}```
Now,in the script we call the function rotatePics with a numerical parameter (why 1 and not 0?).
AT the first round currentPhoto in
Code:
`function rotatePics(currentPhoto) {`
is 1, then we assign numberOfPhotos the number of the pictures (5) and then the currentPhoto value is the result of
Code:
`currentPhoto % numberOfPhotos;`
which is 1%5, so 1. IN general the modulus operation will always give a value smaller than the number of pictures, so between 0 and 4, so I wonder what happens at picture 5 and picture 0 since we pass the function a 1 and not a 0?
Next line
Code:
`\$('#photos img').eq(currentPhoto).fadeOut(function() {`
selects the picture with the currentPhoto index, which at the moment is 1 and the fadeOut method calls a function
where the css of the current image (again 1 in this case because the parameter i is 1) is changed, specifically the z-index which with this operation will always equal to 0. So
Code:
`\$(this).css`
( selects the current css's image (agin current image is 1 so it's z-index is now 0) but \$(this).show(); too refers to picture 1 so how can we then show this picture is it has a
z-index of 0?