     render: ->
 
         message  = @props.message
-        prepared = @_prepareMessage()
-
-        if @state.messageDisplayHTML and prepared.html
-            {messageDisplayHTML, images} = @prepareHTML prepared
+        prepared = @state.prepared
+
+        if @state.messageDisplayHTML and prepared.html?
+            {messageDisplayHTML, images} = @prepareHTML prepared.html
             imagesWarning = images.length > 0 and
                             not @state.messageDisplayImages
         else

        state =
            active: props.active
        if props.message.get('id') isnt @props.message.get('id')
            @_markRead @props.message
            state.messageDisplayHTML   = props.settings.get 'messageDisplayHTML'
            state.messageDisplayImages = props.settings.get 'messageDisplayImages'
            state.composing = false
        @setState state

    _markRead: (message) ->
        # Hack to prevent infinite loop if server side mark as read fails
        messageID = message.get 'id'
        if @state.currentMessageID isnt messageID
            @setState currentMessageID: messageID
            # Mark message as seen if needed
            flags = message.get('flags').slice()
            if flags.indexOf(MessageFlags.SEEN) is -1
                flags.push MessageFlags.SEEN
                MessageActionCreator.updateFlag message, flags

    prepareHTML: (prepared) ->
        messageDisplayHTML = true
        parser = new DOMParser()
        html   = """<html><head>
                <link rel="stylesheet" href="/fonts/fonts.css" />
                <link rel="stylesheet" href="./mail_stylesheet.css" />
                <style>body { visibility: hidden; }</style>
            </head><body>#{prepared.html}</body></html>"""
        doc    = parser.parseFromString html, "text/html"
        images = []


                        isSeen: isSeen
                        isFlagged: isFlagged
                        mailboxID: @props.selectedMailboxID
                        messageID: message.get 'id'
                        message: @props.message
                        onMark: @onMark
                        onMove: @onMove
