Changed $_GET variable locations. Added if statement for when neither parameter is supplied.

Setting the header to image/png *only if* $gradient or $colors isset.