Autonomous learning in humanoid robotics through mental imagery