How can PHP error handling be improved in the given script to identify and resolve issues with image display?

The issue with image display may be due to errors in the file path or file extension. To improve PHP error handling, we can use the `file_exists()` function to check if the image file exists before attempting to display it. Additionally, we can use the `getimagesize()` function to verify if the file is a valid image.

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

if(file_exists($image_path) && getimagesize($image_path)) {
    echo "<img src='$image_path' alt='Image'>";
} else {
    echo "Error: Image not found or invalid format.";
}
?>