Added random, some cleaning

Added random image choosing for testing.
Cleaned up some code