Abstract HTML signature image processing code

Needed because drag/drop images is allowed in compose preview window