use random image retrieval
mysql version random retrieval
debug and refactor