added base adapter class to work with gallery view