I just put it on the `else` for the two `if (attachment)` statements (since doing it only at the end would have missed the case were there is a media and text attachment in the same slide.