What could be causing the thumbnails to appear pixelated in the PHP code provided?

The thumbnails may appear pixelated due to low-quality resizing algorithms being used. To solve this issue, you can improve the quality of the thumbnails by using a higher-quality resizing algorithm such as `imagecopyresampled()` instead of `imagecopyresized()`.

// Load the original image
$original_image = imagecreatefromjpeg('original.jpg');

// Create a new image canvas for the thumbnail
$thumbnail_width = 100;
$thumbnail_height = 100;
$thumbnail_image = imagecreatetruecolor($thumbnail_width, $thumbnail_height);

// Resize the original image to the thumbnail size using imagecopyresampled
imagecopyresampled($thumbnail_image, $original_image, 0, 0, 0, 0, $thumbnail_width, $thumbnail_height, imagesx($original_image), imagesy($original_image));

// Output the thumbnail image
header('Content-Type: image/jpeg');
imagejpeg($thumbnail_image);

// Free up memory
imagedestroy($original_image);
imagedestroy($thumbnail_image);