X-rays are particularly suited to probing the physics of extreme objects. However, despite the enormous improvements of X-ray astronomy in imaging, spectroscopy, and timing, polarimetry remains largely unexplored. We propose the photoelectric polarimeter Gas Pixel Detector (GPD) as a candidate instrument to fill the gap created by more than 30 yr without measurements. The GPD, in the focus of a telescope, will increase the sensitivity of orders of magnitude. Moreover, since it can measure the energy, the position, the arrival time, and the polarization angle of every single photon, it allows us to perform polarimetry of subsets of data singled out from the spectrum, the light curve, or an image of the source. The GPD has an intrinsic, very fine imaging capability, and in this work we report on the calibration campaign carried out in 2012 at the PANTER X-ray testing facility of the Max-PlanckInstitut für extraterrestrische Physik of Garching (Germany) in which, for the first time, we coupled it with a JET-X optics module with a focal length of 3.5 m and an angular resolution of 18 arcsec at 4.5 keV. This configuration was proposed in 2012 aboard the X-ray Imaging Polarimetry Explorer (XIPE) in response to the ESA call for a small mission. We derived the imaging and polarimetric performance for extended sources like pulsar wind nebulae and supernova remnants as case studies for the XIPE configuration and also discuss possible improvements by coupling the detector with advanced optics that have a finer angular resolution and larger effective areas to study extended objects with more detail.