Hi,
I've created a mod to add two new turrets to the game: the cannon turret and the heavy gun turret.
(https://mods.factorio.com/mod/TwoMoreTurrets)
I've partly reused your code, while modifying certain things. In particular, there was a small visual bug: when a turret is damaged or destroyed, the alert icon is not the right size and is therefore cut off. I solved it by removing one of the three images/icons. I left only the one showing four turrets of different sizes and the tech one. Evidently renaming the necessary file names in the code.
If you want to solve this problem in your mod as well, feel free to look at the code.