upgraded replace image method
right order in fun views