I think the second one is not correct, because there the action of picking the can is anterior to your thinking. And it seems, once you're picked up the can, you must KNOW whether it is cold or not The first one is OK, it could be paraphrased as "I picked up the can because I thought it would be cold" The -ing form "action" comes first.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.