The first two parameters of the 'drawRect' method are the location coordinates that the rectangle is to start from on the image it will be drawn on. It is the location where the top-left corner of the rectangle will be. If you place the top-left corner of a rectangle below and to the right of the image, none of the rectangle will be drawn on the image itself. Btw, a new GreenfootImage will have a default drawing color of black; so the last line is not needed:
image.drawRect(0, 0, 50, 50);
This line starts the rectangle at the top-left corner of the created image and gives the size of the rectangle as 50x50.