Fortunately, when you upload an image, discourse does all the work. For the voting post I just take the original image’s url from the entry thread and use it like this:

In this case, discourse will take care of the thumbnail.
If I need to use a specific thumbnail (like for Roberts’s entries) I usually use this:
[](http://artofinterpretation.com/images2019/wc820-CollectorOfAllThingsCosmic-SpeedModelConcept-byrjt2019.jpg)
However, there is probably a better way to do this as the above is just linking to the original image - instead of displaying an overlay/lightbox. I’ll have to check this out some time.
One last thing: Discourse has been updated lately and there have also been a few new image features. @bartv posted some details on this right here: