Added random pixel generation method