Someone helped me with the fix and I would like to share it here.
Check the image in the media library. It should be "shared".
In my case, it wasn't. Don't know why. In quick info the template was
/sitecore/templates/System/Media/Versioned/Jpeg
Changing the template to
/sitecore/templates/System/Media/Unversioned/Jpeg
fixed it.
UPDATE:
If you have many affected media items, here is a powershell script. This script, will change the pdf template of items inside a parent folder.
/*
1. set master DB as the context database
2. Give the target template path (use only template specific subpath)
3. Parent folder path
4. ($_.TemplateName -eq "Pdf") - name of the source template in quotes.
*/
$master = [Sitecore.Configuration.Factory]::GetDatabase("master");
$entryTemplate = $master.Templates["System/Media/Unversioned/Pdf"];
cd master:"\media library\Files\Test";
Get-ChildItem -recurse | ForEach-Object { if ($_.TemplateName -eq "Pdf") { $_.ChangeTemplate($entryTemplate) } };