You could fit a filter in the line, or better for appearance, make it to screw into the tank bush so the gauze is inside the tank. The latter having the advantages of being hidden and taking no space around the loco, while still reasonably accessible for cleaning.
If the tank is of brass, the usual for smaller scale locomotives, it does not need internal paint; and as Baz found with his, it can create more trouble than it solves.