Added console.log + better handling of update image