And the images which are uploaded, they are broken both on the editor and frontend as well.
We started looking more into the problem and found the fix for this at Github of Joomla.
Here is how to fix this :
On file administrator/components/com_media/controllers/file.php Change the line 47 from this
$this->folder = $this->input->get('folder', '', 'path');