Also good idea to make sure PHP is configured to run under the webserver user. This is a php setting in the hosting control panel. This will prevent those nasty issues where the image gets loaded up as root adn you cannot change the permissions or the user back to the webserver user.