Issue 2814: Image attachment resizing

Implemented image attachment resizing. Ready for review.