fixed horizontal images + minor refactoring