Jesus had compassion on the people because they were lost, but they were seeking someone to lead them. So, Jesus took the opportunity and taught them. Sure, some of them did not believe in Him truthfully, but some did. Are there sheep without a shepherd that you know of? Are there any people you know that are desperately seeking a shepherd, but just don't know their true Shepherd is Jesus? Take the opportunity to teach them who He is. I believe wholeheartedly that God puts seekers in our path as an opportunity for us to join Him in what He is doing. God seeks out His sheep. If they are walking aimlessly by you, show them who your Shepherd is.