Hi Yasmena,
Why would you want to change the permissions of your image directory to 777? That would mean that anyone visiting your site, who goes to upload an image would be able to delete all images from that directory! Is that what you really want?
When PHP processes an upload, it stores the file in the tmp directory, which you can then move across to a directory of your choice. If your PHP script does the transfer, it should have the correct permissions to move the file.
R.