Added in random image sampling