Loading images small refactor