Refactors YUVImg class