Analytical formulations of image forces on dislocations with surface stress in nanowires and nanorods