small refactoring on PictureBox handling