Its the initial upload of the image. The 500 problem happens regardless if it's a fresh comment or an edited comment trying to add the image.
Sometimes it happens. Sometimes it doesn't. Im not sure what the factor is but i only upload jpgs and pngs so it's not a file type causing it.
I just tried now and it worked.
Weird.
It definitely has not been working for me for most of the last 7 days or so. The only way I could post was to remove the ! And []
Next time it happens I'll take a screenshot of the error and include the image linked to imgur or something if I can't get it to post.