Update system/libraries/Image_lib.php

Fixing the bug. If image name is dead simple, for example "1", and full path containing that string, for example "path/1/2/3/1", then every occur of "1" inside of path will be replace with empty string.