Image qulity refactor