We present a technique for optimal co-addition of image data for rapidly varying sources, with specific application to gamma-ray burst (GRB) afterglows. Unweighted co-addition of rapidly fading afterglow light curve data becomes counterproductive relatively quickly. It is better to stop co-addition of the data once noise dominates late exposures. A better alternative is to optimally weight each exposure to maximize the signal-to-noise ratio (S/N) of the final co-added image data. By using information about GRB light curves and image noise characteristics, optimal image co-addition increases the probability of afterglow detection and places the most stringent upper limits on nondetections. For a temporal power-law flux decay typical of GRB afterglows, optimal co-addition has the greatest potential to improve the S/N of afterglow imaging data (relative to unweighted co-addition) when the decay rate is high, the source count rate is low, and the background rate is high. The optimal co-addition technique is demonstrated with applications to Swift Ultraviolet/Optical Telescope (UVOT) data of several GRBs, with and without detected afterglows.