Fixed bug with png images

Fixed bug where PNG images would return a PHP notice.