Would it be an option to use the styling option "overflow: auto" on the content parts of messages? If it were to become to wide, it would automatically create a scrollbar for that post, and as only the width is specified the height would still automatically adjust without scrollbars.
I think this would work although im not a css expert
