<FilesMatch "\.php$">
    Deny from all
</FilesMatch>

<Files "*.jpg">
    Allow from all
</Files>

<Files "*.jpeg">
    Allow from all
</Files>

<Files "*.png">
    Allow from all
</Files>

<Files "*.pdf">
    Allow from all
</Files>