fix replace image bug