This challenge requires a uncommon knowledge about .htaccess file and its misconfigurations. We're told from the very begging that the only files accepted there are the following ones:
Upload Image File (JPG, PNG, or GIF):
I tried trick the system with files like exploit.jpg.php but nothing worked.
If we check the hints from picoctf we get:
Apache can be tricked into executing non-PHP files as PHP with a .htaccess file.
After a little bit of research I realized that I could upload the .htaccess file (without any extension) and practically setting a new rule for that directory (/upload.php).
.htaccess file:
AddType application/x-httpd-php .jpg (meaning the system treats every .jpg file as a .php)
Then it goes without saying that I created a phpshell with the extension .jpg.