The way uploading works is that the image will be uploaded to the temp directory of the server and then copied over to the specified upload directory. The reason the name of the file is incorrect is that it gets uploaded with a temporary name and then the name is modified to the correct name when its copied. So some permissions are not set correctly on either the temporary directory or the upload folder. Make sure the permissions on those are set to 777.