The article notes that the chloroplasts are like a larder that the slug can digest when needs be, so storage could have come well before photosynthesis was actually utilized.
Or maybe it was photosynthesis first. The chloroplasts just did their thing for a while, and slugs that digested them slower (and eventually ones that stored them) got more benefit than ones that didn't.