Move image reading to separate method.
Rubocop style recommendations.