diff --git a/resources/qml/delegates/ImageMessage.qml b/resources/qml/delegates/ImageMessage.qml
index 1b6e572983825634d71f5a1c81a499f1f021dfa2..15ce29b7230361cbffa113b47567417142bb9625 100644
--- a/resources/qml/delegates/ImageMessage.qml
+++ b/resources/qml/delegates/ImageMessage.qml
@@ -3,8 +3,13 @@ import QtQuick 2.6
 import im.nheko 1.0
 
 Item {
-	width: Math.min(parent ? parent.width : undefined, model.width)
-	height: width * model.proportionalHeight
+	property double tempWidth: Math.min(parent ? parent.width : undefined, model.width)
+	property double tempHeight: tempWidth * model.proportionalHeight
+
+	property bool tooHigh: tempHeight > chat.height - 40
+
+	height: tooHigh ? chat.height - 40 : tempHeight
+	width: tooHigh ? (chat.height - 40) / model.proportionalHeight : tempWidth
 
 	Image {
 		id: img