added image random manipulation, fix unittest