Image style URL does not work I have an issue related to drupal image styles, and I am not able to fix it since last two days. Have searched and tried everything on google, but of not help. 

I have a drupal instance on production where all the images are stored at imgs/&lt;entity_type&gt;/&lt;entity_id&gt;/&lt;filename&gt;.  All these files have three different styles: thumbnail, entity_image, and slide. All the styles were working initially. Now suddenly most of the times styles do not work. If I change the image, most of the time styles show old images, even if at the URL location no image is present. Sometimes, thumbnails are not getting created. 

To resolve this, the following are the things I already tried:


drush image-flush: Did not help
Changed permissions of styles to 777:  Did not help
Cleared all caches several times: Did not help
Disabled and re-enabled clean URLs: Did not help
Created another instance and tested: Issue persists
Tried to create style forcefully using image_style_url: Did not help
Changed +FollowSymLinks to +SymLinksIfOwnerMatch in .htaccess: Did not help.
Commented Options None and Options +FollowSymLinks in .htaccess: Did not help


Initially it looked like a permission issue but after all this, I am not getting what could be wrong. It could be some issue with inode creation, but not sure. So, please let me know your suggestions, what should be done in this case.

EDIT: I disabled clean URLs and everything worked fine. Enabling clean URLs again gives the same issue. SO it has to do something with the menu I guess, but not sure about the fix. Need a permanent solution as I can not afford to keep clean URLs disabled.
I added following lines in modules/image/image.module, on line 1056 and it started working.

// Create derivated image if it doesn't exist.
  if (!file_exists($file_url) &amp;&amp; !file_exists($uri)) {
    if (file_exists($path)) {
      $current_style = image_style_load($style_name);
      image_style_create_derivative($current_style, $path, $uri);
    }
  }


FYI: This change comes with a risk of when Drupal core updates, this will get removed. Also, I found it affected the performance of search in our platform. So, need a permanent solution.