Fixed error: crashed when no image has been previously opened