PHP when modifying URL

This was brought to my attention. If you chop off parts of the URL when viewing the large image you will get a PHP error? I was told that it needs an error catch??

Warning: getimagesize(): Read error! in /home/www/html/main.php on line 1412

Warning: Cannot modify header information - headers already sent by (output started at /home/blaa/blaa/blaa/blaa/www/html/photos/main.php:1412) in /www/html/photos/main.php on line 116


style="display:inline-block;width:468px;height:60px"
data-ad-client="ca-pub-8698264690166658"
data-ad-slot="4417389723">