refactoring - bug with loading images
bugfix