[eluser]umefarooq[/eluser]
first of all you have to save you gallery record in database and after that while querying, retrieving from database give gallery id in query to select specific gallery also use pagination to control 10 photos for each page.