fixed HTML generation when there is only 1 page worth of photos