setup and fixes to img processing