Still, don't use lightning. Lightning is used to kill players and remove entities, there are other commands to do that. Lightning is annoying for players online and is also significantly less efficient.
There's no way to stop lightning from destroying item frames, just don't use it.