I still face the broken images issue after using question_rewrite_questiontext_preview_urls method (method call used in render_question_text of report.php).
Following is the code snipped I have used :
$this->context->id, 'question', $question->id);
displayed the resultant text in a table , which still displays the broken images.
I see the following url for the broken images :
which is different from the url generated for the actual image during quiz attempt
On observation I came to know that 1900 it the question_usage_id, but I'm unable to trace the location where exactly this value gets appended.