Fix formatting, added two new methods and fixed duplication of processing image