revamp image retrieval interface
fix getWord function to avoid type punning