helper method to get image