@ccc You're right but I did not want to improve the Python, only a way to solve the bug. Thus I added the two lines in the same style.
Oops! Looks like something went wrong!
You may only upload PNG, JPG, or GIF files ()