added gen_hex() for better image names, next stop: db