Add getImage function to retrieve image resource