added random image support