Clear cached versions of a specific file in all styles.
$path: The Drupal file path to the original image.
function image_path_flush($path) {
$styles = entity_load_multiple('image_style');
foreach ($styles as $style) {
$image_path = image_style_path($style
->id(), $path);
if (file_exists($image_path)) {
file_unmanaged_delete($image_path);
}
}
}