What potential error could occur when using the script to display images?

When using the script to display images, a potential error could occur if the file path to the image is incorrect or if the image file does not exist. To solve this issue, you should ensure that the file path is accurate and that the image file exists in the specified location.

<?php
$image_path = 'path/to/your/image.jpg';

if(file_exists($image_path)){
    echo '<img src="' . $image_path . '" alt="Image">';
} else {
    echo 'Image not found';
}
?>