image shuffling function achieved