Where am I going wrong

I’m making a basic script to upload an image to a folder, and then retrieve it on the web page using the id and extension.

Where am I going wrong?;

Front end

The upload page

The function:

The account.php

Everything is linked in the config file using $dice. The category name uploads perfectly but it’s getting the image to upload to the folder which isn’t working..

Any ideas?