diff --git a/app/assets/javascripts/discourse/views/composer/composer_view.js b/app/assets/javascripts/discourse/views/composer/composer_view.js
index 71c2c3d6f87..bcd13aea56a 100644
--- a/app/assets/javascripts/discourse/views/composer/composer_view.js
+++ b/app/assets/javascripts/discourse/views/composer/composer_view.js
@@ -128,11 +128,12 @@ Discourse.ComposerView = Discourse.View.extend(Ember.Evented, {
// of the post into the stream when the user hits reply. We therefore also
// need to enforce these rules on the .cooked version.
// Meanwhile, the server is busy post-processing the post and generating thumbnails.
- $(''
- ).appendTo('head');
+ var style = Discourse.Mobile.mobileView ?
+ 'max-width: 100%; height: auto;' :
+ 'max-width:' + Discourse.SiteSettings.max_image_width + 'px;' +
+ 'max-height:' + Discourse.SiteSettings.max_image_height + 'px;';
+
+ $('').appendTo('head');
},
click: function() {