You should rotate around z axis i.e. glRotatef(45,0,0,1). To rotate around images's center try this code
Code:
glPushMatrix;
glTranslatef(x+W/2,y+H/2,0);  //transate to the center of the image
glRotatef(45,0,0,1); //rotate
glBegin(GL_QUADS); //draw
glVertex2i(-w/2,-h/2);
glVertex2i(w/2,-h/2);
glVertex2i(w/2,h/2);
glVertex2i(-w/2,h/2);
glEnd;
glPopMatrix;