fixed bug in scramble code for images