public static function ImageSize($Path, $Filename = FALSE) {
      if (!$Filename)
         $Filename = $Path;
      
      if (in_array(strtolower(pathinfo($Filename, PATHINFO_EXTENSION)), array('gif', 'jpg', 'jpeg', 'png'))) {
         $ImageSize = @getimagesize($Path);
         if (!is_array($ImageSize) || !in_array($ImageSize[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)))
            return array(0, 0, FALSE);
         return $ImageSize;
      }
      return array(0, 0, FALSE);
   }