its pretty simple to do, there are a few good examples at www.php.net/manual/en/features.file-upload.php on how to get started.
First to ensure the filesize limit, use the MAX_FILE_SIZE trick they explain on that link above.
To limit the width and height, I would use the [man]getimagesize[/man] function to check if its the right size, but to prevent any extra file create, use getimagesize on the $FILES['userfile']['tmp_name'] variable so if it is too big, you can exit without writing any files in your directory.
To limit the type, just use the $FILES['userfile']['type'] field. you can explicitly check for image/jpeg or image/gif.
to rename the image, you can use [man]move_uploaded_file[/man] and the [man]file_exists[/man] function to see if where you are moving it will be overwritten or created.
that info should get you started.