modal window shows for image editing
some refactoring