You could cheat it and save yourself some heavy lifting by setting the default image to be a Twitter logo, so when the XML returns no image, its just the bird image.
As for the text, just put an auto squeeze on the text and build your template for 200 characters and you'll never run out of room.
Edit: Also, check the 'Max Height' thread that was recently bumped for another solution.
#XPression