There are two ways to handle a child when something like that handles in my opinion.
When you punish a child, obviously it is out of anger. Punishment only harms a child because it is a negative way to teach them what to do and what not to do.
Discipline is a way of correcting their bad behavior by saying "This is to keep you from hurting yourself or someone else."
As most people know, Discipline is the best approach when dealing with anyone, especially children.
There are also two ways to discipline a child.
A story i like to use is when i ask children what they want to do when they are older. Once a little girl said Veterinarian. I told her that was awesome because i too love animals. When i asked the next girl what she wanted to do she also replied with Veterinarian. The odds both girls wanted to be that on their own is simple. But then after hearing our approval of the girls being vets, the children who had given different answers actually changed it and started saying, "I want to be a veterinarian too!" Children, like adults, seek approval.
If you give a child a cookie or a sticker every time they do something good, it makes them want to do the good to get the reward and praise. Everyone enjoys and craves some type of praise.
If however, you spank a child for every bad, there is no motivation. If they stop doing the bad, it is only out of fear(granted sometimes rebellion.
If a child does something simple like the above picture, i would never punish or discipline them unless it was on purpose. Even then i would be careful. Because doing so would cause them to be afraid and they might hide it the next time they accidently or purposefully do something wrong. Which we all know is bad.