the dwarves were captured by thorn and the wood elves long enough for bilbo to help them escape
Bilbo kept from being captured by the Wood Elves in Mirkwood by using The Ring to turn himself invisible. He slipped in after the company of Elves that had captured the other members of The Company (namely, the twelve dwarves) as the Elves were escorting the dwarves into the Elven fortress.
He doesn't. Instead, he puts on his Ring and sneaks unseen with the captive dwarves in with them.
They took them to the halls of the Elven King in his hall, a large cave at the edge of Mirkwood. The wood elves of Mirkwood, in the Hobbit, took the thirteen dwarves to their king's halls, where they were locked in by cellars and a magic gate.
They escape in barrels sent downriver to be filled.
I think it was Bilbo Baggins
In The Hobbit, they are simply identified as "Wood Elves". Later, they were further identified as being Silvan Elves led by the Sindar, Thranduil (who is the father of Legolas).
Floating in barrels downriver.
The battle was just starting when the orcs showed up. They were the common foe of all and the elves, dwarves, and men fought against them instead of each other.
well
Yes, in chapter 9 the dwarves (but not Bilbo) were imprisoned by the Wood-elves in Mirkwood forest.
They are immortal.
They were tired and hungry with no food or water. At least with the elves, they were fed.Because they had lost their way in Mirkwood and were on the brink of starvation.