added pagination to image retrieves