First measure your water parameters... There are many factors that cause a fish to flash. Basically, anything that can cause an irritation will cause them to scratch on surfaces. Declining water quality (high ammoina, low pH), parasites, bacterial infection, food trapped in gills and even a simple itch. You need to cancel out the probability that it's your water before assuming that your fish have parasites.
The evidence of those white worms tells me that you probably have some decaying food in your tank. Therefore, measure the ammonia and pH and correct it with water changes if that's the problem. Some of my fish will flash shortly after a heavy feeding but that is normal.
If your water parameters are in check and your fish are flashing then chances are your fish have parasites. Carefully inspect the fish for spots. If they don't, then it could be flukes. Unfortunately, the only way to confirm is by taking a scrape and observe through a microscope because they are not easily visible with the nake eye. All these problems can be a result of feeding feeders without proper quarantine.
Try to narrow down the cause before thinking about medicating your tank. The fix might just be as simple as increasing your water changes and doing a gravel vac. Good luck.