hope you can help me, thanks!=)

i need to display something like this: x of y pictures.
the y is the number of total pictures in the database.
how do i get the x?

i'm making a 'slideshow' of the pictures of the members on a site, just like what friendster does.

thanks and more power!=)