fixing image change bug