Charge transfer in CCD
The gates shown in your diagram are not pixels. They are only demonstrating the charge transfer mechanism.
In an image sensor, only every third gate is connected to a pixel (photodiode), and the gates are driven by multi-phase clocks, such that there is always isolation (at least one gate that is &quot;off&quot;) between one pixel's charge and the next.
This image, taken from How a Charge Coupled Device (CCD) Image Sensor Works, shows the relationship between gates and pixels:

The charges are moved top-to-bottom in the main &quot;Image Section&quot; part of the array, using clocks \$I\phi 1\$, \$I\phi 2\$ and \$I\phi 3\$. Then, at the bottom (&quot;readout&quot; section), they are moved right-to-left toward the output buffer, using clocks \$R\phi 1\$, \$R\phi 2\$ and \$R\phi 3\$.
Only one or two out of every three MOSFETs contain charge from a particular pixel at any given time.