convert big pictures to jpeg before encryption