Implemented image masking