fix stack, add some image processing