Factor image-getting into a helper method.