Moved img.onload wireup and removed unused megapix comment