refactored images main
refactoring