The two functional groups you're talking about are actually very different, the only thing they share is the protonated nitrogen. Piperidine you'll want to think of as a base, and protonated it loses its reactivity. Imines, on the other hand, you want to think of like carbonyls. And in that situation, protonating the amine makes it even more reactive, so it's the opposite effect that you see with piperidine.