For directory chmod 777 it often stores images, library...
Create .htaccess file content:

PHP Code:
<Files "^.*\.(php|cgi|pl|php3|php4|php5|php6|phtml|shtml|asp)">
Order allow,deny
Deny from all
</Files

Is this code correct? Is there anything else i can do to protect my /pic folder?