code refactoring and improvements on searching the horizontal corner line
code refactoring of images functions
code refactoring of import functions