Image and Icon upload fixed.
Please verify and test your changes before commit! This was an very unneccessary bug.
mysql_query returns not an resource which isnt a object. it also returns FALSE when something went wrong.