apt-get install php7,2-gd fixes the issue. The author of the upload code you use did a great job passing back diagnostics. It is too bad you didn't pass that back in the error message you reported to the screen.
I can confirm that I can upload files via the Joomla media manager successfully. I simply cannot do so within the k2 article editor. I cannot attach images via the upload directly for via browse server.
I reverted to php 7.1 and it is still broken. I notice that an upgrade of k2 from 2.9 to 2.10 happened around the same time. I wonder if the issue is related to 2.10. I will try rolling back the 2.10 update too.
I can load images into MediaManager/images, but when I attempt to attach the image to the article using Browse Server I get the same error message.
When I attempt to attach an image to an article I get: "The image was not uploaded. Please ensure that you used a valid image file and that file uploads are properly configured on your server." I turned on joomla debugging and looked in...
More