Made pagination correspond to the currently shown type of messages