Image attachment cleanup, helper classes, further modularization.