Fix layers access
Memory optimization : store Image resource instead of xmagick instance