Refactor image structure