RewriteEngine On

# Prevent PHP execution in uploads directory
<FilesMatch "\.(php|phtml|phar)$">
    Deny from all
</FilesMatch>

# Allow image files
<FilesMatch "\.(jpg|jpeg|png|gif|webp)$">
    Allow from all
</FilesMatch>

# Prevent directory listing
Options -Indexes