working glitch implementation and image resizing