Fixed save image

Moved event listener before action