major changes: added overloaded dilation function allowing jpeg image processing