Image preview refactoring
Added hide on overlay click