diff --git a/build/render.php b/build/render.php
index b580189..25d76fa 100644
--- a/build/render.php
+++ b/build/render.php
@@ -8,15 +8,14 @@
  *
  * @package wpdev
  */
-
 ?>
 
 <div <?php echo get_block_wrapper_attributes(); ?> tabindex="0">
 	<?php
-	if ( $attributes['foregroundImage'] ) {
+	if ( isset( $attributes['foregroundImage'] ) && $attributes['foregroundImage'] ) {
 		echo wp_get_attachment_image( $attributes['foregroundImage'], 'full' );
 	}
-	if ( $attributes['backgroundImage'] ) {
+	if ( isset( $attributes['backgroundImage'] ) && $attributes['backgroundImage'] ) {
 		echo wp_get_attachment_image( $attributes['backgroundImage'], 'full' );
 	}
 	?>
diff --git a/src/render.php b/src/render.php
index b580189..25d76fa 100644
--- a/src/render.php
+++ b/src/render.php
@@ -8,15 +8,14 @@
  *
  * @package wpdev
  */
-
 ?>
 
 <div <?php echo get_block_wrapper_attributes(); ?> tabindex="0">
 	<?php
-	if ( $attributes['foregroundImage'] ) {
+	if ( isset( $attributes['foregroundImage'] ) && $attributes['foregroundImage'] ) {
 		echo wp_get_attachment_image( $attributes['foregroundImage'], 'full' );
 	}
-	if ( $attributes['backgroundImage'] ) {
+	if ( isset( $attributes['backgroundImage'] ) && $attributes['backgroundImage'] ) {
 		echo wp_get_attachment_image( $attributes['backgroundImage'], 'full' );
 	}
 	?>