simplified get img function
fixed conflict