Context. The European space astrometry mission Gaia, to be launched by 2012, will construct a dense optical QSO-based celestial reference frame which will need to be linked to the International Celestial Reference Frame (ICRF; the IAU fundamental frame), with the highest accuracy. However, it has been found that only 10% of the ICRF sources (70 sources) are suitable to establish this link. The remaining sources are not useful either because they are not bright enough at optical wavelengths or because they have significant extended radio emission which precludes reaching the highest astrometric accuracy. Aims. In order to improve the accuracy of this alignment, we have developed a program of VLBI observations based on three steps to detect, image and measure astrometric positions of weak extragalactic radio sources, with bright optical counterparts, from a sample of 447 candidate sources. Methods. The experiments devoted to VLBI detection, carried out with the European VLBI Network (EVN) in June and October 2007, were very successful, with 398 sources detected at both S-and X-bands. From these, 105 sources were observed in March 2008 with a global VLBI array (EVN and VLBA; Very Long Baseline Array) for imaging their VLBI structures. Results. All sources were successfully imaged in both bands and about 50% (47 sources) were found to be point-like on VLBI scales. These images are available at http://www.obs.u-bordeaux1.fr/BVID/GC030/. VLBI positions of these sources will be measured accurately in future astrometric experiments.