diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module
index f5a76a8..b12fa43 100644
--- a/core/modules/filter/filter.module
+++ b/core/modules/filter/filter.module
@@ -1202,10 +1202,15 @@ function _filter_html_image_secure_process($text) {
  * @see _filter_html_image_secure_process()
  */
 function filter_filter_secure_image_alter(&$image) {
+
   // Turn an invalid image into an error indicator.
   $image->setAttribute('src', base_path() . 'core/misc/message-16-error.png');
   $image->setAttribute('alt', t('Image removed.'));
   $image->setAttribute('title', t('This image has been removed. For security reasons, only images from the local domain are allowed.'));
+  $image_factory = \Drupal::service('image.factory');
+  $error_image = $image_factory->get('core/misc/message-16-error.png');
+  $image->setAttribute('height', $error_image->getHeight());
+  $image->setAttribute('width',  $error_image->getWidth());
 
   // Add a CSS class to aid in styling.
   $class = ($image->getAttribute('class') ? trim($image->getAttribute('class')) . ' ' : '');
