Fixed bug where randomImages was only considers while initialization.