Praise be to Allah the Lord of the Worlds.
There is nothing wrong with manufacturing some foods in the form of images, even animates, because they are meant for eating and not worship or glorification and the like. Islamic Sharia allows the use of images in children`s toys. The reference is that Bukhari and Muslim narrated that 'A'isha reported that she used to play with dolls in the presence of Allah's Messenger. This hadith has been narrated on the authority of Hisham with the same chain of transmitters with a slight variation of wording. "Judge Eiyaad said that this narration indicates the permissibility of playing with children`s toys and that they are excluded from the forbidden images."{Shareh An-Nawawi Ala Muslim, 15/204}
. Al-Shabramallasi(May Allah have mercy on him) said, "Cake images made for promotion aren`t forbidden to sell or make."{Hashiyat Al-Shabramallasi Al Nehayat Al-Mohtaj, 3/396}.
In conclusion, there is nothing wrong with making cake and sweet images, because they are meant for promotion, not glorification. And Allah the Almighty knows best.