if (PCPIN_CLIENT_AGENT_NAME == 'IE') {
     header('Cache-Control: Public');
     header('Pragma: Public');
 } else {
     header('Pragma: Public');
 }
 $thumb_loaded = false;
 if (true === $session->_conf_all['allow_gd'] && !empty($b_x) && pcpin_ctype_digit($b_x) && !empty($b_y) && pcpin_ctype_digit($b_y)) {
     // Thumbnail
     if (!isset($bg_r) || !pcpin_ctype_digit($bg_r) || $bg_r < 0 || $bg_r > 255 || !isset($bg_g) || !pcpin_ctype_digit($bg_g) || $bg_g < 0 || $bg_g > 255 || !isset($bg_b) || !pcpin_ctype_digit($bg_b) || $bg_b < 0 || $bg_b > 255) {
         $bg_r = hexdec(substr($session->_conf_all['thumb_background'], 0, 2));
         $bg_g = hexdec(substr($session->_conf_all['thumb_background'], 2, 2));
         $bg_b = hexdec(substr($session->_conf_all['thumb_background'], 4, 2));
     }
     $thumb_img = '';
     if (PCPIN_Image::makeThumb($thumb_img, null, null, $binaryfile->_db_list[0]['body'], $b_y, $b_x, 'jpg', $bg_r, $bg_g, $bg_b)) {
         $thumb_loaded = true;
         header('Content-type: image/jpeg');
         $etag = md5($thumb_img);
         header('Etag: ' . $etag);
         if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] === $etag) {
             header('HTTP/1.1 304 Not Modified');
         } else {
             echo $thumb_img;
         }
     }
 }
 if (!$thumb_loaded) {
     if (!empty($filename)) {
         header('Content-Disposition: inline; filename="' . $filename . '"');
     }