Updated to check for Collection & Paginator

Added an "OR" to the elseif checking for a collection in order to also check if the class is an instance of paginator.

This hasn't been tested other than trying it in code to check it works!