Resize working! Watermark added. Some changes were necessary in the original source code