render: fix crash when shows DM with media (fixes #39)

(cherry picked from commit 0b31f4df15e958cacfafc1cab2dc9a1901d2e9e7)