Although photons in vacuum are massless particles that do not appreciably interact with each other, significant interactions appear in suitable nonlinear media, leading to hydrodynamic behaviours typical of quantum fluids(1-6). Here, we show the generation and manipulation of vortex-antivortex pairs in a coherent gas of strongly dressed photons (polaritons) flowing against an artificial potential barrier created and controlled by a light beam in a semiconductor microcavity. The optical control of the polariton flow allows us to reveal new quantum hydrodynamical phenomenologies such as the formation of vortex pairs upstream from the optical barrier, a case of ultra-short time excitation of the quantum flow, and the generation of vortices with counterflow trajectories. Additionally, we demonstrate how to permanently trap and store quantum vortices hydrodynamically generated in the wake of a defect. These observations are supported by time-dependent simulations based on the non-equilibrium Gross-Pitaevskii equation(7).