What are best practices for incorporating images into PHP scripts for display purposes?

When incorporating images into PHP scripts for display purposes, it is best practice to use the `imagecreatefromjpeg()`, `imagecreatefrompng()`, or `imagecreatefromgif()` functions to create an image resource from the file. Then, use the `header()` function to set the content type of the image before outputting it with `imagejpeg()`, `imagepng()`, or `imagegif()`.

// Specify the path to the image file
$image_path = 'path/to/image.jpg';

// Create an image resource from the file
$image = imagecreatefromjpeg($image_path);

// Set the content type header
header('Content-Type: image/jpeg');

// Output the image
imagejpeg($image);

// Free up memory
imagedestroy($image);