You can of course have a structure but the it will be quite odd because the size of table will be according to size of biggest cell , also the size of table will have to be defined during allocation so what you will be doing is placing an image according to the size of text and it will be quite odd as rest of cell will be simple white.
Now . You will have to implement the logic to change the size of image in layoutSubviews Method of UITableViewCell as You can get the size of text from the chat message using sizeWithFont method of NSString PLease see String size in label
and then you will have to set the frame of each cell or image in the delegate method of uitableview "- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath "
You can add as many labels as required in custom UITableViewcell (or controls).
Custom cell Tutorial
Alternatively you can create a custom view where in you can define methods to add subviews with the image as background cropped to match the size of message , below each message and create an array of strings or dictionary of string to keep a track of messages from different users.